Return to the consulate to retrieve the passport. It is unlikely that there will be more than half a dozen (if that many) consulate generals of any given country within your country of residency. In the United States, most consulate generals have jurisdiction over multiple states. As such, the probability of living near the consulate general's office is slim. Luckily, applications for most tourist visas can be made by mail (through an approved visa courier service, see step two);although for many countries applications for long-stay visas such as student or work visas must be done in person. There is no pattern to determine which countries require physical presence. For example the Consulate General of France requires physical presence for long-stay visas, while the Consulate General of Italy does not. Please refer to the website of the consulate general of the specific country of your destination for verification.
If you are applying in person, usually you will receive you passport (with visa) at the end of your appointment. If the specific consulate has a turnaround time, you will be given the date upon which you may retrieve your passport and visa. Again, the policies of all consulate generals vary.
Pay a certified courier service to send it back to you. If the consulate general you are dealing with does not require your physical presence, you may send your passport and visa application in the mail to the Consulate General. The courier service will return your passport to you when it has been approved by the Consulate General (they will return it if your visa is denied as well). Depending on the courier, the fee can be steep, ranging from $50 to $100. Though, it does pale in comparison to the cost of round trip airfare to the consulate. Most visa couriers are safe and reliable. Research and compare various couriers to find a rate and company suitable to your needs (refer to Resources listed below for courier suggestions).
Call the consulate if the procedure is taking an unusual amount of time. If you have not received your passport within the dates outlined by the courier service or have not been given a date for its retrieval, (first) call the courier service, and then call the Consulate General. Passports and visas are sensitive documents and their security should not be taken lightly.