In short most nationalities do not need a visa but you need to get a tourist card in advance. They cost about US$25 and are valid for up to 30 days.
You will need a tourist card prior to arriving in Cuba, you should check with the airline. Tourist cards may be available at the airport, check with the airline you are flying with.
Visitors should possess an effective passport or a trip document stating their name and the corresponding visa or Tourist Card, excepting those countries that Cuba maintains Free Visa agreements with. Tourist Cards can be requested at the Cuban consular representations. The airline or tourist agent may give/sell you a tourist card. Otherwise you may need to buy one from a travel agent or and embassy.
Nationals from Antigua and Barbuda, Barbados, Belarus, Benin, Bosnia and Herzegovina, Dominica, Grenada, Kenya, Malaysia, Mongolia, Montenegro, Namibia, North Macedonia, Russia, Saint Kitts and Nevis, Saint Lucia, Saint Vincent and the Grenadines, Serbia, Singapore and United Arab Emirates can enter without a visa.
Cuba visa regulations
Cuban embassies, and embassies in Cuba
Cuban visa exemptions