James Cook was the son of a farm labourer. He didn't have much of an ambition, so he was apprenticed to a haberdasher/grocer at the age of 16. He didn't show much promise here, either, having little aptitude for the trade, so his employer introduced him to local shipowners, who took him on as a merchant navy apprentice. Here he was educated in algebra, trigonometry, navigation, and astronomy, which later set Cook up to command his own ship.
After working his way up to positions of greater responsibility and experience, Cook was hired in 1766 by the Royal Society to travel to the Pacific Ocean to observe and record the transit of Venus across the Sun. After this, the young Lieutenant Cook was sent to part of the British Merchant Marine and later the Royal Navy during the Seven Years' War. It was these experiences that led to him becoming a captain.