Well, they say - “occupy your mind and your body will follow”…
That said, I have heard of custody of the eyes as a way of not looking at stuff that might give rise to evil thoughts… With respect to popular media, I guess you could go to the USCCB’s website for movie reviews, and - if something isn’t given a good rating due to sex, violence, language, or etc., you could then just stay away from it. There’s also filtering software for porn and such on the internet.
Basically, when you take custody of the mind and imagination - what you want to practice is almost like a sort of sense deprivation - the idea be to simply not listen to, look at, touch, taste or smell something that could leave you with some imaginary occasion of sin… It’s basically using your mind to tell your eyes to look away… and so on with every other sense…
Now - to take custody of your mind - which governs your senses is a bigger task… You may not really be able to do it very easily… Often times, thoughts just happen - especially through habits, physical infirmity (such as illness), weather, other people you meet in the course of upholding life’s responsibilities, etc…
Some people can block stuff out… Saint Faustina said when she would pray she would be oblivious to her surroundings… I myself would have a really difficult time doing so… However, what I have found helpful is reading good, high quality literature… reading usually plants lots of positive ideas… I’ll read for a few hours, and that time will have been spent focusing my mind on something positive… Then, when I walk out into the world, I’ll carry those thoughts with me…
It’s a form of “positive self talk”… It works like - suppose, for example, someone cut me off in traffic… If I have been away from reading some Theology, then I might get mad and think more and more bad thoughts… But, if I have been reading some good books, and I am on a spiritually higher plane - I’ve found I’m more likely to recall some merciful thought… or, if I really am grumpy, then I’ll go to a Spiritual friend to commiserate, and that friend will usually pull me around…
Also, I wouldnt beat yourself up if you aren’t always 100% in custody of your senses… we live in a world which really makes it hard to find a pure and pious existence… In fact, if you really ignore some of those things, then you could just weaken yourself if and when you happen to run into them… That has been my experience anyway, so - when I see something that challenges my spirituality - it can also becomes an opportunity to strengthen myself… I’m not always sure of how to deal with it, but then I do learn from those experiences… try Saint Ignatius Spiritual Exercises and rules for Discernment… They might help…
Good reading and the sacraments seem to be most helpful…