The reason I'm asking is because of Washington D.C.'s location. It wasn't easily accessible by land and it wasn't easily traveled to by waterways. In what battles were the British able to get to Washington D.C. to burn down the White House?
British Major General Robert Ross landed his brigade on 18 August 1814 at Benedict, Maryland, less than 40 miles (65 km) from Washington DC. The Royal Navy had blockaded Chesapeake Bay since spring 1813, and the US had built the Chesapeake Bay Flotilla for protection; this was trapped in the Patuxent River, enabling the British to land.
The only significant battle was on 24 August at Bladensburg, about 9 miles from Washington DC, where Ross defeated a larger force of US militia under Brigadier General William H. Winder.
He then immediately proceeded to Washington DC and burnt the White House, Capitol, Navy Yards and other public buildings that night in retaliation for the earlier burning of Toronto (then called York) and other Canadian towns.
Ross then joined the wider British attack on Baltimore, but died in the Battle of North Point on 12 September.
@Henry covered the tactical angle, there's also a strategic one.
The War of 1812, lasting from 1812 to 1815, happened at the tail end of Britain fighting France and Napoleon since 1792. Until 1814 it was a side show for the British, particularly the bulk of the British Navy was preoccupied blockading France and French occupied territory.
But in April 1814 Napoleon was finally defeated and sent into exile by the Sixth Coalition; he'd be back in a year, but the British didn't know that at the time. With the apparent end of the Napoleonic Wars, the British were free to turn their full attention to the war with the US.
The bulk of these forces went to Canada to invade New York, they were defeated in the Battle of Plattsburgh. Some, including a brigade of Duke Wellington's veterans, joined the forces blockading the US Atlantic coast. With these additional forces the British planned two raids, one against Baltimore and one against Washington DC, to divert forces away from the Canadian border.
The US Secretary Of War did not think the British would attack Washington DC as it had little strategic value, choosing to concentrate on defending the important seaport of Baltimore, and so Washington DC was left lightly defended.