Ditto that Malwarebytes program....works great.
We use Malwarebytes at work to stop ransomware.
You can also do the following.
I saved my file as Stop Ransomeware.js
People will click on this and it will execute the script, connecting to a download server, fetching the actual ransomware in the form of a Windows program (an .EXE file), and launching it to complete the infection.
The way to counter this is to create a text file with notepad and rename it with the js extension. Then right click on it and tell it to open this with Notepad from then on.
This way if one accidentally downloads one of these and clicks on it, it won’t execute.