There are different types of visa and you can easily find out online which kind is available for your destination. The cheapest option is always the one you obtain on arrival and you normally don’t need any particular applications before the departure. This type of visa is called VOA (Visa On Arrival) and you have to go to the right desk and pay the necessary fee to get this. The process is not so complicated but this doesn’t mean that you can just walk through the immigration straightaway. First you need to know which form you need to fill out. Some countries have separate sheet for everything such as short term visit and long term visit. The sections that apply to you must be filled out correctly. Once your documents are ready, go and find out if you pay the cost separately at different desks or one desk handles everything at the same time.
I had seen so many backpackers lined in a queue for a VOA desk being sent back to an opposite desk because they did not have a receipt of their visa payment. They were complaining that there was no proper signs, but in my opinion they should have asked the airport staff unless they are 100% sure what they are doing. The VOA desk area could be really packed and chaotic depending on the country, so be prepared to wait for a while when you see a bunch of crowd gathering instead of queueing. You might need a photo for the application so make sure you do your research before, and bring some anyway if you are worried.