Born in Frankfort, Kentucky, the son of Martin Davis Hardin and Elizabeth Logan, Hardin pursued classical studies and was graduated from Transylvania University, Lexington, Kentucky, where he studied law. He was admitted to the bar in Kentucky in 1831 and commenced practice in Jacksonville, Illinois. He served in the Illinois Militia during the Black Hawk War of 1832. He was brigadier general in command during the Illinois Mormon War in Hancock County, Illinois, in 1844. He later attained the rank of major general. He was appointed prosecuting attorney of Morgan County in 1832. He served as member of the Illinois House of Representatives 1836–1842. His son Martin Davis Hardin was born in 1837, and his daughter Ellen Hardin Walworth was born in 1832.
He was co-editor/founder of the Illinoisan newspaper in Jacksonville in 1837. He was credited with helping to avert a duel between Abraham Lincoln and State Auditor James Shields. In February 1844, Harding was present on the USS Princeton when one of its guns exploded, and he helped manage the aftermath of the disaster, staying on the ship for nearly a week.
Hardin was elected as a Whig to the Twenty-eighth Congress (March 4, 1843 – March 3, 1845). Despite large popularity in his district, he was not a candidate for renomination in 1844. It has been suggested that Hardin's premature death helped Lincoln's rise to prominence in Illinois politics.
Despite being an unabashed Whig, Hardin was a fervent supporter of the Mexican-American War that was advocated by James K. Polk and many expansionist Democrats. During the war, he recruited the First Regiment, Illinois Volunteer Infantry, of which he was commissioned colonel. On February 23, 1847, he was killed at the Battle of Buena Vista, Mexico, after attempting to lead a charge against a Mexican battery. The outpouring of grief over his death was immense, and Hardin's funeral procession was attended by 15,000 people. He was interred in City Cemetery (East), Jacksonville, Illinois. Hardin County, Iowa, was named in honor of the Colonel and his legacy.