Many years ago, the United States Government banned its citizens from travelling to Cuba and spending money there. The Supreme Court ruled the travel ban was unconstitutional, but allowed the ban on spending.
Many Americans choose to travel to Cuba, and spend money there illegally, every year. Tens of thousands do so, compared with a much smaller number who go legally. No one is known to have ever gotten in trouble for breaking that law, however.
To go legally, one usually needs to obtain a license from the Department of the Treasury. Exceptions include US Government officials, Cuban natives and sometimes people visiting sick relatives.
If you don't fit into any of these categories, you have to contact the Office of Foreign Assets Control. They require you to write to them and will decide whether or not you qualify.
There are some cases in which they will accept your application. If you are researching "human rights violations" or taking humanitarian aid, you can go. Professional research, such as journalism, or college-level educational reasons also should allow you to receive permission.
If you do not qualify, you have one more option. If you are fully hosted, meaning you spend no money while in Cuba, you can go without breaking the law. Your host must pay for meals, housing, food, transportation, etc. It is acceptable to pay to only in only if you are aboard a non-Cuban airline.
For those who receive permission to go, you can spend up to $100 per day. Those who are fully hosted are not allowed to spend money.