Yarnall was born in Wheeling, Virginia (later West Virginia), Yarnall was appointed midshipman in the Navy on 11 January 1809. Between 1809 and 1812, Yarnall cruised the coastal waters of the United States in Chesapeake and Revenge performing duty that was tantamount to blockading his own country to enforce President James Madison's embargo on trade with the European adversaries during the Napoleonic Wars. In 1813, he was transferred to Oliver Hazard Perry's command on the Great Lakes and became the first lieutenant on board Perry's flagship, Lawrence. He participated in the decisive Battle of Lake Erie on 10 September 1813 and, though wounded, refused to leave his post during the engagement. When Perry shifted his flag to Niagara during the battle, Lt. Yarnall assumed command of Lawrence. After the battle, he took the squadron's wounded on board and carried them back to Erie for medical attention. For his performance in the battle, Yarnall earned Perry's commendation as well as a medal expressing the gratitude of Congress and the country.
