Cuba is just like most countries: upon arrival or soon thereafter, you exchange your foreign currency into local currency. In Cuba, there are two currencies, pesos convertibles (Cuban Convertible Pesos, designated as CUC and sometimes called divisas) and the Cuban peso, also called moneda nacional (national currency, designated as CUP). Many Cubans refer to both as pesos and both are often denoted by $, the dollar sign.
Most foreign currencies are acceptable in Cuba. The one foreign currency to avoid bringing is US dollars, as there’s an additional surcharge of 10% on top of the exchange rate, although it is perfectly legal to have and use US dollars in Cuba.
Just as when you go to Spain or Mexico, you need local currency to purchase things in stores, so too in Cuba you need local currency for your purchases. Except for a few designated tourist areas where it’s permitted to use Euros, you’ll need pesos convertibles and, for some things, Cuban pesos. It’s a good idea to carry CUCs in low denominations, as some places have difficulty giving change for large bills. As well, if you want to pay with CUC 50 or 100 notes, you may need to show your passport.