It depends on what phone you have. Some phones have bootloaders you can't unlock, and you can't do much at all with that. If you can unlock the bootloader, your options are determined by which third-party Android builds support your hardware.
LineageOS is a popular option with pretty broad device support; GrapheneOS is a privacy/security focused option that only runs on Pixels.

๐