If you are using an android phone, you can change the ROM to one that still gets updates, it’s like changing the os in a computer. The process will delete all of the user data inside the phone but you’ve got nothing to lose if it doesn’t get any security updates.
I recommend lineageOS to anyone wanting to go down this route because of its compatibility with every phone, old or new.