He attended the common schools and was graduated from Williams College, Williamstown, Massachusetts, in 1818. He studied law, and was admitted to the bar in 1821.
Barnard began practice in Rochester, New York, and served as prosecuting attorney of Monroe County in 1826. Elected as an Adams to the Twentieth Congress, Barnard served as United States. Representative for the twenty-seventh district of New York from March 4, 1827 to March 4, 1829. He was an unsuccessful candidate for reelection in 1828 to the Twenty-first Congress.
Hr traveled in Europe in 1831, and moved to Albany, New York, in 1832 and continued the practice of law.
Barnard was elected as a Whig to the 26th, 27th and 28th United States Congresses, holding office from March 4, 1839, to March 3, 1845. He served as chairman of the Committee on the Judiciary (Twenty-seventh Congress).
As a leading intellectual in the Whig party, Barnard gave a number of speeches, including to the literary societies of Amherst College in 1839 and to Yale Phi Beta Kappa Society in 1846. Not a candidate for reelection in 1844, Barnard resumed his practice.
He was appointed Minister to Prussia and served from September 3, 1850, to September 21, 1853.
He retired from active business pursuits in 1853 and engaged in literary pursuits, residing in Albany, New New York Barnard died in Albany, New York, on April 24, 1861 (age 63 years, 282 days). He is interred at Albany Rural Cemetery, Menands, New York where he had given the dedication address in 1844.
He served as member of the State assembly in 1838.