In 1851 William is a pilot (ship’s pilot?)
He may have guided vessels in & out of Ayr harbour. Went out in a small boat to a larger vessel.
Newton on Ayr is on the north side of the River Ayr and Ayr harbour.
Coal from the Ayrshire coalfields was transported to Ireland from Ayr port. 1839 railway at Ayr harbour.
https://www.ayrshirescotland.com/ayr-history.html Added. 2 modern photos of harbour on here. Clicking on large image of either on Flicker and then going on to view more pics of the harbour on Flicker shows one which has foundations of the old railway line bridge.
A modern description of the approach to the harbour on visitMyHarbour.com. "... the harbour is best avoided in strong onshore winds ... Approach is best made from a long way off ... Various shallow patches and rocky outcrops ... " History is lower down the page.
https://www.visitmyharbour.com/harbours/west-scotland-northern-ireland/ayr/expanded.aspAyr Harbour Memories is a Facebook group.
There was a busy coastal trade for goods and passengers from western ports, up & down the River Clyde, to Scottish islands, along the coast of Britain and across to Ireland and Isle of Man. A steamer carried passengers from Ardrossan in the north of Ayrshire to Liverpool (later destination was Fleetwood in Lancashire). Local newspapers in port towns carried shipping news - names of vessels leaving & arriving, destinations, cargoes, storms disrupting shipping, shipwrecks.