I personally wouldn't buy a 3rd gen Tundra yet (2022+), but that's just me. New engine or not, I don't trust them yet. They disrupt so many things when replacing these engines and they aren't holding value as much as the old ones. In addition to that, if the 2026 and beyond have fewer issues, I think the 2022-2025s will lose even more value on the used market due to the track record.
The 2010-2021 Tundras were great when maintained well. If you are looking at higher mileage units or just older trucks, make sure they have performed coolant changes on the 5.7L at least once, if it's a 2020ish it's not the end of the world, you can do one after purchase, but anything older I'd want to see evidence of that.
The 2019 and older had a nice external transmission cooler, they removed it beyond 2019.
How long are you going to keep it? If it's really long term, I'd go 2nd gen.