Forrest was born in Philadelphia in the Province of Pennsylvania. During the American Revolutionary War he was commissioned a captain in Colonel Thomas Proctor'sPennsylvania Artillery Battalion on October 5, 1776. He led a 52-man company of artillery at the Battle of Trenton on December 26, 1776. Situated on high ground at the head of King and Queen Streets, his two brass six-pound cannons and other American guns helped dominate the battlefield. He was promoted to major on March 3, 1777, and lieutenant colonel on December 2, 1778. He resigned October 7, 1781.
Forrest was elected as a Federalist to the 16th Congress. He served as the first chairman of the House Committee on Agriculture, after it was created on May 3, 1820. Seven representatives, under the chairmanship of Forrest, were assigned to the new committee.
He was again elected as a Federalist to the 17th Congress to fill the vacancy caused by the resignation of William Milnor. He was an unsuccessful candidate for reelection in 1822.