Idiom
take someone's mind off somethingtake (someone's) mind off (something/someone)
if an activity takes someone's mind off their problems, it stops them from thinking about them.That's the good thing about helping other people - it takes your mind off your own problems.