Answer by taking a quote from the following article:

Captain James Cook  (7 November 1728 - 14 February 1779) was a British explorer, navigator, cartographer, and captain in the Royal Navy. Cook made detailed maps of Newfoundland prior to making three voyages to the Pacific Ocean, during which he achieved the first recorded European contact with the eastern coastline of Australia and the Hawaiian Islands, and the first recorded circumnavigation of New Zealand. Cook joined the British merchant navy as a teenager and joined the Royal Navy in 1755. He saw action in the Seven Years' War, and subsequently surveyed and mapped much of the entrance to the Saint Lawrence River during the siege of Quebec.

During the Seven Years' War, Cook served in North America as master aboard the fourth-rate Navy vessel HMS Pembroke. With others in Pembroke's crew, he took part in the major amphibious assault that captured the Fortress of Louisbourg from the French in 1758, and in the siege of Quebec City in 1759. Throughout his service he demonstrated a talent for surveying and cartography, and was responsible for mapping much of the entrance to the Saint Lawrence River during the siege, thus allowing General Wolfe to make his famous stealth attack during the 1759 Battle of the Plains of Abraham.  Cook's surveying ability was also put to use in mapping the jagged coast of Newfoundland in the 1760s, aboard HMS Grenville. He surveyed the north-west stretch in 1763 and 1764, the south coast between the Burin Peninsula and Cape Ray in 1765 and 1766, and the west coast in 1767. At this time Cook employed local pilots to point out the "rocks and hidden dangers" along the south and west coasts. During the 1765 season, four pilots were engaged at a daily pay of 4 shillings each: John Beck for the coast west of "Great St Lawrence", Morgan Snook for Fortune Bay, John Dawson for Connaigre and Hermitage Bay, and John Peck for the "Bay of Despair".  His five seasons in Newfoundland produced the first large-scale and accurate maps of the island's coasts and were the first scientific, large scale, hydrographic surveys to use precise triangulation to establish land outlines. They also gave Cook his mastery of practical surveying, achieved under often adverse conditions, and brought him to the attention of the Admiralty and Royal Society at a crucial moment both in his career and in the direction of British overseas discovery. Cook's map would be used into the 20th century--copies of it being referenced by those sailing Newfoundland's waters for 200 years.  Following on from his exertions in Newfoundland, it was at this time that Cook wrote that he intended to go not only "farther than any man has been before me, but as far as I think it is possible for a man to go".

how did the maping of Saint Lawrence river help?
allowing General Wolfe to make his famous stealth attack during the 1759 Battle of the Plains of Abraham.