Well the thing is Russia was smart. They knew this kind of thing was coming or strongly possible for a decade now. And they took steps. They required certain amounts of presence of key information for running businesses be kept in country, they planned for a disconnect of their internet from the global system. They required global tech companies to store Russian information and act on it via hardware and software located within Russia. This all meant that foreign powers, mainly the US/NATO could not completely forcibly take all their stuff and go home. They could stop taking the profits home, they could cut ties and refuse to bring new things over, to engage with Russia. But they couldn't take the knowledge, the infrastructure, etc which could simply be re-sold at a massive punishing discount to local Russian interests which is one of the reasons why their economy didn't implode (if they were able to do that, to just shutter all McDonalds, all western branded consumer businesses, to shut down electronic services, networks, etc remotely and wipe everything) then Russia's economy probably wouldn't be in such a good state.
It's one of the reasons that as much as I think Russia waited too long to do the Ukraine operation. I can understand why. They only really understood and began taking the years-worth of planning to protect themselves around 2014-16 and it took some time to implement all that to make them resilient enough that we get the result we have today which is Russia not only withstanding sanctions but flourishing because of them in some respects.
China is also smart in this respect. They require western internet businesses to use a Chinese partner company so the west cannot destroy everything on its way out by ordering its corporations to just wipe everything and get on a plane.