It depends greatly on the malware that attacked you. Like any software, some malware is written better than others. Some use poor encryption that can be broken. Some can be fooled into decrypting your files just by tricking them into believing their payment server was paid (the "Jigsaw" ransomware is stupid like this.) But others are using high security approaches that can't be so easily thwarted.
The best approach is always to recover the lost files from a backup (on an uninfected computer, of course!), and wipe and rebuild the infected box. If that's not possible, you may have to decide whether or not to pay the ransom, and quickly. Ransomware typically comes with some kind of evil countdown clock that will permanently delete more and more files as time elapses and the payment deadline approaches; they may also delete a large number of files in retaliation if they detect a reboot or if the ransomware is killed, restarted, or tampered with.
If recovery isn't possible, your next best bet is to use a different computer to find out what kind of ransomware you were infected with, and google for specific advice for recovering your data. If self-recovery isn't in your comfort zone and the encrypted data is extremely valuable, consider calling a computer security firm.
Remember, once you're infected don't shut the attacked box off, don't reboot it, just work quickly to preserve what you can. If you do need to power it down, make sure you physically kill power instantly. You should remove the battery or unplug the power cord, instead of pressing the power button and waiting for it to shut down, or using the 'Shutdown' menu option. Use the powered down time as an opportunity to make a backup of the disk image before you restart it. This will preserve additional files from being deleted by the malware when it comes back up.