Embassies/consulates have emergency numbers they answer 24 hours a day. Save (on your phone) the phone number of your nearest embassy/consulate when abroad. If you get in many kinds of trouble (with the police, other legal issues, medical stuff, if you’re a victim of a crime, lost your passport, etc.), they can help you much more effectively than your family/friends back home can.