'Yellow Journalism' is a term that refers to sensationalist and often inaccurate reporting by certain newspaper publishers (the off-white color of the cheap paper that these publishers used for their newspapers is what gave them the nickname 'Yellow' journalism).
In the late 19th century (roughly 1870s to 1900), the main way in which people in the United States learned about the news was through newspapers, of which there were hundreds of different newspaper publishers throughout the country, big and small, local and national. This, of course, is before the invention of radios or movies, much less the internet.
The sale of newspapers, therefore, was very big business, involving millions and millions of dollars because just about everyone bought at least one newspaper every day. Therefore, competition between different newspapers was fierce and every newspaper publisher wanted as many people to buy their papers - and not other publishers' papers. Less than honest newspaper publishers were more than willing to publish stories that involved exaggeration and half-truths, knowing that the more sensational the stories, the more likely people would buy their newspapers. This is the reason for the birth of 'Yellow Journalism'.
In the late-19th century the Caribbean island of Cuba, located a short distance from Florida, was still a colony owned by the European nation of Spain. Many of the people of Cuba resented Spanish rule and sought to win their independence through violent rebellion. The war in Cuba between the Spanish forces and the Cuban Patriots made for an exciting and easily sensationalized story in the pages of newspapers in the United States. Drawing a parallel between our own struggle for independence against a European nation and the struggle of the Cuban people, it was only natural for most people in the U.S. to sympathize with the Cuban freedom fighters. It was easy for 'Yellow Journalism', therefore, to depict the Spanish rulers of Cuba as cruel villains (the Spanish didn't much help themselves by the harsh methods they used to crush the rebellion, which played into the hands of 'Yellow Journalism').
The sensational 'Yellow Journalism' stories reported in newspapers created a public outcry among readers in the United States that, in turn, put pressure on the government, led by President William McKinley (President from 1897-1901), to do 'something'. It was common practice in the 19th century for powerful nations to send their warships to intimidate less powerful nations when these nations had a disagreement, a practice that was nicknamed 'Gunboat Diplomacy'. To send a strong message to the Spanish Government that the United States opposed the way the Cuban people were being treated, President McKinley ordered the armored cruiser, U.S.S. Maine, to pay a visit to the harbor of Havana, the capitol city of Cuba,
It was during this visit that, on 15 February, 1898, that, without warning, the U.S.S. Maine blew up in Havana harbor. Some 260 U.S. sailors aboard the U.S.S. Maine were killed by the explosion. Without any evidence to prove their claim, the competing 'Yellow Journalism' newspapers, the New York Journal owned by William Randolph Hearst and the New York World owned by Joseph Pulitzer, proclaimed that it was the Spanish government that had intentionally detonated an explosive device under the U.S.S. Maine (an investigation by the U.S. Navy later found that it was almost certainly an accidental explosion inside the ship that had caused the disaster - the Spanish had had nothing to do with it).
Hearst and Pulitzer were in competition with each other for readers to buy their respective newspapers and, therefore, used the methods of 'Yellow Journalism' - sensationalism, exaggeration, half-truths, and even outright lies - to attract readers to purchase their newspapers. Hearst and Pulitzer took up the popular cry "Remember the Maine and to Hell with Spain!" These newspapers led the popular call among the people of the United States to go to war against Spain in revenge for Spain's attack on the U.S.S. Maine (an attack that simply had not taken place). Public pressure, promoted by 'Yellow Journalism', forced President McKinley - who wanted to avoid a war with Spain - to ask Congress for an official Declaration of War.
The Spanish-American War of 1898 resulted in the defeat of Spanish forces in Cuba, so that Cuba gained its independence. But the United States reserved the right to intervene in Cuba's affairs if it felt that this was necessary (wealthy U.S. businessmen owned sugar and tobacco plantations in Cuba - if they felt that their investments in Cuba were threatened by unrest, they would put pressure on the U.S. Government to do 'something'). But, in addition, the United States gained a small overseas Empire as a result of the War because U.S. forces also attacked Spanish colonies other than Cuba. This included the Caribbean island of Puerto Rico and both the Philippine Islands and the Island of Guam in the Pacific Ocean, both of which President McKinley chose to keep as U.S. possessions, regardless of the wishes of the Puerto Ricans and Filipinos (indeed, the Filipinos fought against U.S. occupation and had to be defeated in a war that lasted until 1902). In addition, during the Spanish-American War, the U.S. seized territories in the Pacific Ocean that were not Spanish colonies, specifically the independent kingdom of the Hawaii.
The 'Americans' - a vague term indeed, which 'Americans'? - did not use 'Yellow Journalism' to get what they wanted, to get an Empire in the Age of Imperialism. In fact, one could argue the those who used the methods of 'Yellow Journalism', such as William Randolph Hearst and Joseph Pulitzer, used the American people to get what they wanted - profits from the sale of their newspapers.