First of all you have to go to the nearest POLICE station of that country where you are now. Then file a complaint about the incident that you lost your Passport.
Secondly, you have to go to your Country's Embassy and then have to explain the whole Issue about the incident.
They can ask you more details to prove that you are actually a citizen of that particular country's embassy.
After these things done properly the Embassy of your country will Issue a permit by which you can only go back to your Country.
You can only go back to your home country with the special permit provided by your country's embassy. You can't visit other country with it. After going back to your country you can issue a new Passport.