My father was in the Merchant Navy and I've not found online records for that, but he kept his papers, so we know the ships he was on. However, I do wonder if they've yet to scan in early military records, as I've got a line of people in the army and there seems to be a cut-off around 1870ish. It could be those records are still in Kew
I also had some family members pass through Scotland on their way from Ireland to Liverpool and Scottish record can be a pain to track down.
The main site uses a credit system, which is the least helpful system and can lead to you sinking a lot of cash to find anything (if at all):
https://www.scotlandspeople.gov.uk
It is run by the National Records of Scotland who have a guide to all the types of records available and where to find them:
https://www.nrscotland.gov.uk/research/family-history
See if it suits you better than me (as I say I have only a passing Scottish connection and if you invest more time, it might become easier) but it might be you'll have equal success on the main sites like Ancestry and Find My Past (you can test them out as libraries and the Mormons can provide free access).