You can exchange domestic currency to a foreign currency at a number of places. These places include selected local banks, ATM's, airport exchange, and conversion centers.
In the same way that money facilitates exchange in a single economy, exchange of currencies facilitates the exchange of goods and services across the boundaries of countries.