Tanks haven't been made obsolete when used appropriately. Russia's extremely heavy loss of tanks is in large part due to using tanks incorrectly. Bad maintainence, bad training, bad logistics and bad application of tanks. Terribly bad in some cases. Sending tanks in alone was well known as being a bad thing to do almost as soon as tanks existed back in WW1, but Russia has been doing that now. Which is nuts unless you know your enemies never have any weapon more powerful than a rifle. I don't understand how any military could screw up using tanks so badly. I know better and I'm just a civilian with a slight interest in history.
Tanks have been a dangerous place to be at least as far back as WW2. Anti-tank weapons were much worse then than now, but so were tanks. WW2 planes and guns could destroy WW2 tanks. From 2 miles away in the case of some anti-tank guns. The most famous being the German PAK 43. That had a maximum range of ~15Km, although much less if you wanted a good chance of hitting the tank. But 2 miles away, sure. Maybe not with the first shot, but shells are much cheaper than modern missiles so if you had adequate logistics you could just fire half a dozen times.
The reason why tanks aren't obsolete is that they do something useful in war and there isn't anything else that does it as well. Their vulnerabilities don't negate the fact that there isn't a replacement for them, so the emphasis (except in Russia, apparently), is on mitigating the vulnerabilities of tanks rather than on replacing tanks.
There's a more detailed video here, if you want more detail from someone with far more knowledge than me:
Indeed , active protection systems are making tanks far more survivable, you only have to look to Israel and thier merkavas armed with trophy systems to show the tank and heavy armour in general are far from dead.