No one wants to expect danger, but it’s good to be informed just in case. If you think you're in a dangerous situation in a foreign country and the local authorities won’t be helpful to you, then your best bet is getting to the nearest embassy. Embassies are most helpful day-to-day for replacements of lost and ruined passports, helping you vote or file taxes while abroad, and issuing legal documents like birth and death certificates. However, they are also the place to offer short-term protection in certain situations. If you’re somewhere where the local authorities could be helpful, start there as they are more equipped to help you quickly, and then reach out to your embassy if need be.