I'm currently in the market for a new phone because Samsung ended security updates for my current one, not because there's anything wrong with it. And I'm noticing that my choices seem to be buy a phablet or buy a total POS.
Remember when Samsung made a flagship phone in multiple sizes, and then also made a giant phone so big it had a built-in stylus? It wasn't that long ago. Now the flagship phone comes with a stylus.
You may want to take a look at Fairphone if you want a phone that gets updates for a long time. The current one will be supported at least until 2028, maybe 2031.
I'd love to get a fairphone, but the 4 is only available on T-Mobile (or it's MVNOs) which doesn't work for me, and the 5 has no plans for a US release.