Hi ^-^/

I've heard and seen this phrase a few times

"Береги свою голову, там мозги"

I tried to translate it by myself, and I got
"Take care of your head, brains are there"

Then i tried googling it and couldn't find any translation. So I was wondering if my translation was correct and whether or not this an idiom or something?

Thanks in advance