One way to shift your thoughts from him is to practice mindfulness. When you catch yourself thinking about him, bring your attention back to the present moment. Engaging in activities that bring you joy and fulfillment can also help you shift your focus.