And having lived through that, and now lived through the walled garden/App Store experience, I'll say with confidence the old way was better.
They didn't, though; they just muddled through and asked their friends or some tech support service to reinstall Windows occasionally, when the viruses, adware and other crap made the computer too slow, or when the ramsomware encrypted all their files.
a) Educate users and give them more knowledge and better tools to easily protect themselves
or
b) Have app-stores organized in such a way that user interests and legitimate security concerns are not conflated with commercial interests of the platform owners as it's currently the case. Either treat app stores as a public utility with rights and regulations or require all devices to support competing stores.