Is it safe to take healthy doses of ritalin (methylphenidate) to study better for exams?

Not recommended. Only use for FDA approved uses and only prescibed by a doctor for an approved indication.
Not always helpful. There are studies that show that students that use stimulants to study for exams do not do as well as students who do approopriate preparation and get a good nights sleep before an examination.
Short ans: not wise. Not sure what you mean by "healthy" doses, but other than helping you stay up longer, there's little to no evidence that Ritalin (methylphenidate) helps academic performance even with individuals who have adhd, let alone those who do not. The actual risk of major harm with brief use is relatively low (though people with unsuspected heart problems have dropped dead); prolonged use can cause psychosis.