A ransomware is a type of malware that steals information from computers and demands money or ransom to give back the stolen information.
The WannaCry is a similar ransomware. Once it infects your computer it starts encrypting your data. Once encryption is complete the ransomware demands money for the decryption of your files, generally in bitcoins. Currently the ransomware is demanding approx $300 worth of bitcoin currency for the decryption key.
How to be safe:
The best way to be safe from this attack is to update your operating system. After finding out about the ransomware Microsoft released a patch for their operating systems including Windows XP and Server 2003. Stop downloading content from suspicious websites and illegitimate sources and use a trustworthy antivirus; also make sure that the virus definitions are up to date.