All three channels exist, and which applies depends on the destination and your nationality. The trend is firmly toward e-visas and electronic travel authorisations: you apply on the government's official portal, upload documents, pay online, and receive approval by email. Traditional embassy applications survive for countries without e-visa systems and for nationalities excluded from them, sometimes involving appointments, biometrics, and passport submission. Visa on arrival remains an option in some places but ties you to queues and cash at the border.
One warning deserves emphasis: search results for e-visas are full of lookalike agency websites charging multiples of the official fee for the same application. Always reach the portal through the government's immigration or foreign ministry site, or the embassy's official page.
On timing: e-visas typically resolve in days but apply at least a couple of weeks out; embassy visas deserve four to eight weeks of lead time, more in peak season, since appointments alone can bottleneck. Never book non-refundable travel until the visa is actually granted.