Unless it is extremely urgent, do not use your phone whilst on a plane or ferry. It’s really expensive! When you get off the plane, your phone will most likely connect to a local network and start working without you needing to do anything. However, if this is not the case, you might need to enable data roaming manually:
Go to Settings > Mobile Data > Mobile Data Options and select Roaming On
Go to Settings > Mobile Networks Settings or SIM & Network settings > Data Roaming On.
If you still experience issues after that, or if it looks like your phone is struggling to connect to the internet, you will need to manually connect to a different network until you find one that works.