John asked: “How do these scammers get into my computer and lock it up and tell me I have to call a toll-free number to get it fixed? And what can I do to prevent them from doing that?”
John, that tech support scam is likely getting into your computer through something known as “bundling.”
You probably installed a free program that you needed and as part of the “recommended” installation it added a bundled in adware scam.
The way around that is typically to opt for the advanced installation and make sure none of those optional programs are selected on the installer, and to keep an eye on what you’ve installed recently in case they show up unannounced.
Luckily, anti-adware software does exist and can usually get rid of those scams. Try running Malwarebytes, it should be able to scan your PC and detect and get rid of most of those.
If it can’t, there are others you can try, like AdwCleaner, or BitDefender’s own Adware Removal Tool.