You can practice mindfulness techniques for the same. Setting timers also helps for focused homework sessions. Also, limiting access to distractions like social media helps loads.