People say that carriers are obsolete because:
Hypersonic missiles are getting increasingly more powerful, to the point where it isn’t possible or economical to defend a carrier. Not only that, hypersonic missiles might have a longer range than carrier aircraft in the future (based on my own research, the F-35 still has a longer combat radius than most current missiles, though that’s because the Zicron doesn’t exist).
Submarines are getting quieter, to the point where they can easily destroy carriers.
Carriers are too big of a target. Some people use this argument and extend it to all surface ships.
If you’re curious, I personally disagree that these developments are too big of a problem, making them obsolete. Just my opinion.
People say tanks are obsolete because:
Tanks are easier to be targeted by anti-tank missiles, which have longer range than tanks.
Tanks are too expensive.
Aircraft have gotten more powerful to the point where they can replace the role of tanks.
Keep in mind my summary might be wrong, this is just what it seems reading some articles saying they’re obsolete.