You have to find a phone that is compatible with open source Linux Phone OS. Most of the OS websites give a listing of what phone make/model works. FYI, almost all the Google Pixel phones work.
Here are a few I am keeping an eye on when my Pixel 4a/5G stops getting updates from Google…this year. /
LineageOS/ GrapheneOS/ CalyxOS/ e.foundation/
Youtube videos and other websites are good sources on how to install, etc.