How did Spain help the Americans in the Revolutionary War?
They helped indirectly by joining France in declaring war against Britain.
At the Battle of Saratoga, the Continental Army proved themselves capable of winning a major battle. This convinced the French to help the Continentals by declaring war on Britain. Spain soon also declared war on Britain, not because they wanted to directly help the colonies, but rather as allies of France.
The more countries that joined against Britain, the more Britain's troops and resources were stretched thin. Their taxpayers were soon tired of paying for the war, and as a result the British soon gave up and Treaty of Paris was created.