Soooo how to we get it back?
Generally don't keep your phone in your pocket, put it in another room on silent. Disable lockscreen notifications for all apps but the essentials. Do the same to your computer. No screen time 2 hours before bed.
Do long cardio workouts outside.
Recognize that it's OK to be bored, you don't need to fill every gap by looking at your phone. It's OK just to let your mind wander around.