It is really scary that hackers can now hold your computer hostage and they will force you to pay money so you can have your PC working again. I heard many of these ransomwares gets activated if you click certain ads or pop ups. Many of these can surpass the most popular Anti-virus and anti-malwares out there. Many of these hackers will try to force you to pay money via credit card or bitcoins.
There is no assurance your computer will go back to normal if you pay them money. I really have no idea how to avoid them but I heard they were very active in those sites that has something to do with piracy.