First, let's begin with an overview. The Spanish-American War took place in 1898 between the Spanish and Americans over territory and imperialism. The US intervened in the Cuban War for Independence. Soon afterwards, the USS Maine was sunk near Cuba, and although we are not completely positive what happened, most assume that Spain retaliated for their loss of Cuba. During the war, both Cuba and Philippines fought against Spanish imperial war, and ultimately the US won. The Treaty of Paris (1898) gave the US temporary control of Cuba as well as indefinite colonial control of Guam, Puerto Rico, and the Philippines. Guam and Puerto Rico remain US territories today.
The US was able to win the Spanish-American War primarily because of superior naval power. While the most famous charge was Teddy Roosevelt's Rough Riders charging up San Juan Hill, the naval forces in the Philippines were also very important for American success. The Battle at Manila Bay in the Philippines was very much one-sided; the Americans had far superior weapons and a much larger fleet.
In additional to the naval power, the Americans had local support. Both the Cubans and Filipinos fought alongside American troops to remove Spanish colonial forces and rule. Having a powerful army, navy, and support from the local population was a major help.