How to think about things when it's the right time?
What you refer to is probably 'controlling' your mind, which is a common practice called 'mindfulness training', i.e., learning to observe thoughts without interacting with them.