 Farquhar took a degree at King's College, Aberdeen and began to study medicine under James Gregory.In 1760 however he abandoned his medical studies in Edinburgh and Glasgow and joined the 19th Regiment of Foot in the British Army as a surgeon.In 1761, the regiment was sent to Belle Île and subsequently to Gibraltar, where it remained at the end of the conflict.