Cuba has two currencies that you come into contact with as a tourist. One is the “local” currency, the Cuban Peso (CUP). The other one is the Convertible Peso (CUC), which is used for everything related to tourism.
Both currencies are easy to distinguish: the Cuban peso (both notes and coins) have a face on the bill or coin. The convertible peso is missing the face.
The CUC is pegged to the Dollar in currency terms. However, a fee of 10% is currently charged (as of the end of 2019) if you want to exchange Dollars for CUC. This fee does not apply to exchanges from other currencies (Euros, Pounds, ect).
The CUP is worth 1/25th of the CUC. You have to be careful not to accidentally accept CUP as change if you expect CUC. As I said, face or no face. Take your time and check the change, no one is in a rush in the country.
Hotels, restaurants, souvenir shops, private taxis ect. all accept and take CUC as currency. Buses and shops for locals (supermarket ect) in turn accept CUP as currency. As a tourist, you should therefore primarily focus on CUC, but possibly have a smaller amount of CUP as well.
You cannot buy the currencies outside of the country, whoever enters the country would do well to exchange some money at the airport. It is necessary to present a passport - however experience has shown that local dealers have a “suitable” passport for the machines readily available.
Also important: shops and restaurants only accept cash. Credit card payments are not possible. There are several hundred ATMs in Cuba, but all cards from American providers are blocked due to the embargo. Cards from institutes from other countries may work, but it’s a good idea to inform your own bank in advance.
Since you cannot buy or exchange the currency outside the country, you have to exchange the remaining money when you leave the country. Plan a little more time for it, the queue at the airport can be an hour long. You will need your passport (this time your own) and, if necessary, the receipt from the first exchange. Only round amounts are exchanged - whereby “round” depends on the respective employee at the counter, the exchange rate and the available foreign currency. You might be left with a small amount of CUP/CUC afterwards.