Can someone help me with a phrase please?

Helo, I’m writing my first Welsh postcard and am trying to find a way of saying “It keeps me sane.” I think this is possibly a complicated construction in Welsh - or else there is an idiomatic phrase for it that translates as something completely different in English! I’ve tried a couple of the online dictionaries that have been recommended on here but they are drawing a blank. I don’t trust Google translate, but it is coming up with “Mae’n fy nghadw’n gall” or “Mae’n cadw fi i ganu.” Are either of those correct? Any help much appreciated - thanks!

I would probably have said “Mae’n cadw fi’n gall” - which is just a more colloquial way of saying the first google option you mentioned.
The other google option is a more idiomatic one, as is “Mae’n cadw fi yn fy iawn bwyll” (it keeps me in my right sense) or “Mae’n cadw fi yn fy nhwyll a synnwyr” (it keeps me in my sanity and senses).

Thanks Siaron, that’s great! Not sure why the online dictionaries struggled so much with the phrase but there you go, nothing beats a real Cymraeg speaker.

It’s my 2nd language, but hey, I’ll take the compliment! :grin: