Alternative OSes for phones use the same carriers as everyone else. You can choose to use your phone on wifi only, without a carrier, to avoid using a carrier. You can also choose to use a VPN to make your data inaccessible to the carrier (although they’d be able to tell what cell towers you connect to).
In order to switch over, check the compatibility information for each of the OSes you’re looking at. If you don’t have a compatible phone, you’ll need to get one. Then you follow the install instructions for the chosen OS. GrapheneOS was very easy to install for me – I switched to it when my old phone broke.
Joplin