Ransomware is a specific type of malware that encrypts your files so you’re unable to access or use them, and then offers to decrypt them if you pay the ransom. It is possible through several ways to get access to the encrypted data, like using the public-key encryption method and finding the decryption key. Many tools such as Alcatraz Locker, Apocalypse, BadBlock etc can also be used. But the far most famous method is to keep backups and use that data so that one doesn't have to pay for any tools in the market.