When traveling abroad, you may need to contact your country's embassy or consulate. These are government offices that represent your home country and its interests. In a crisis, the embassy or consulate can help you connect with family back home and address other needs.
The embassy usually represents the interests of your home country and acts as its representative for that nation. Embassies are located in another country for security reasons. If something were to happen to the embassy, such as an attack, it would not affect the home country as much if it were located in the same city. A consulate is a smaller version of an embassy that offers limited services and only represents a single city instead of an entire nation.
The type of services offered by these buildings depends on where they are located and the agreements between two countries. Before you travel, you will need to check with your local government and the foreign government to see if there is an office.