Answer the question at the end by quoting:

Canby was born in Piatt's Landing, Kentucky, to Israel T. and Elizabeth (Piatt) Canby. He attended Wabash College, but transferred to the United States Military Academy, from which he graduated in 1839. He was commissioned a second lieutenant in the 2nd U.S. Infantry and served as the regimental adjutant. Although often referred to as Edward Canby, a biographer has suggested that he was known as "Richard" during childhood and to some friends for most of his life.
During his early career, Canby served in the Second Seminole War in Florida and saw combat during the Mexican-American War, where he received three brevet promotions, including to major for Contreras and Churubusco, and lieutenant colonel for Belen Gates. He also served at various posts, including Upstate New York and in the adjutant general's office in California from 1849 until 1851, covering the period of the territory's transition to statehood.  Against his wishes, he was assigned to what was supposed to be the civilian post of custodian of the California Archives from March 1850 until he left California in April 1851. The Archives included records of Spanish and Mexican governments in California, as well as Mission records and land titles. Evidently, Canby had some knowledge of the Spanish language, which was extremely useful as the government was trying to unravel land titles. (The Filson Historical Society in Louisville, Kentucky holds what appears to be a document written in Canby's hand in Spanish, in which he identifies himself as "Edwardo  [sic] Ricardo S. Canby.")  Canby served in Wyoming and Utah (then both part of the Utah Territory) during the Utah War (1857-1858). During this period, he served on the panel of judges for the court martial of Captain Henry Hopkins Sibley. Sibley was acquitted. Subsequently, Canby wrote an endorsement for a teepee-like army tent which Sibley had adapted from the American Indian style.  Both officers were later assigned to New Mexico, where in 1860 Canby coordinated a campaign against the Navajo, commanding Sibley in a futile attempt to capture and punish Navajo for "depredations" against the livestock of settlers. The campaign ended in frustration, with Canby and Sibley rarely sighting Navajo raiders. Usually they saw the Navajo at a distance and never got close to them.

what did he do in the military?

During his early career, Canby served in the Second Seminole War in Florida and saw combat during the Mexican-American War,

IN: Harry was born in the Lindo Wing of St Mary's Hospital in Paddington, London, on 15 September 1984 at 4:20 pm as the second child of Charles, Prince of Wales, heir apparent to Queen Elizabeth II, and Diana, Princess of Wales. He was baptised with the names Henry Charles Albert David, on 21 December 1984, at St George's Chapel, Windsor Castle, by the Archbishop of Canterbury, Robert Runcie. His godparents are Prince Andrew (his paternal uncle); Lady Sarah Armstrong-Jones (his paternal cousin once removed); Carolyn Bartholomew (nee Pride); Bryan Organ; Gerald Ward (former officer in the Household Cavalry); and Celia, Lady Vestey (nee Knight).

On 17 March 2015, Kensington Palace announced that Prince Harry would leave the Armed Forces in June. Before then, he would spend four weeks throughout April and May at army barracks in Darwin, Perth and Sydney whilst seconded to the Australian Defence Force (ADF). After leaving the Army, while considering his future, he would return to work with the Ministry of Defence, supporting Case Officers in the Ministry of Defence's Recovery Capability Programme, working with both those who administer and receive physical and mental care within the London District area in a voluntary capacity.  On 6 April 2015, Prince Harry reported for duty to Australia's Chief of the Defence Force, Air Chief Marshal Mark Binskin at the Royal Military College, Duntroon in Canberra, Australia. Harry flew to Darwin later that day to start his month-long secondment to the ADF's 1st Brigade. His visit included detachments to NORFORCE as well as to an aviation unit. While in Perth, he trained with Special Air Service Regiment (SASR), participating in the SASR selection course, including a fitness test and a physical training session with SASR selection candidates. He also joined SASR members in Perth for live-fire shooting exercises with numerous Special Forces weapons at a variety of ranges and completed an insertion training exercise using a rigid-hull inflatable boat. In Sydney, he undertook urban operations training with the 2nd Commando Regiment. Training activities included remotely detonating an Improvised Explosive Device (IED) and rappelling from a building. He also spent time flying over Sydney as co-pilot of an Army Black Hawk and participated in counter-terrorism training in Sydney Harbour with Royal Australian Navy clearance divers.  Harry's attachment with the ADF ended on 8 May 2015, and on 19 June 2015 his career with the Army ended.

What did he do when he left the forces?

OUT:
working with both those who administer and receive physical and mental care within the London District area in a voluntary capacity.