Upvote:5
Generic answer:
The experts in dealing with this situation are your country's consulate in the foreign country. (If your country has an embassy in the host country, the embassy will usually also act as a consulate, but this is not always true -- be sure to research it in advance. Even if your country has an embassy they may also have consulates that are closer to where you find yourself, particularly in large countries).
Before you leave home, look up the contact details for the relevant consulate(s) and keep them with you, in several different places such that you're unlikely to lose all of them to pickpockets or burglars.
The consulate will be able to arrange for an emergency passport so you can return home. They will usually recommend (and often require) that you go to the host country's police and report the theft of the original passport. Since dealing with these situations is one of the core purposes of a consulate, they will also have the practical experience to know which local bureaucracy is involved in dealing with the loss of the visa.