I'm 33 and I'm in a very similar boat. Actually exactly the same to be completely honest. Several things have helped me cope with those thoughts. First one was force myself not to think about it. Whatever spare time I have, fill it up with something and avoid just sitting/laying down and contemplating. Books, walks, exercising, movies, stupid youtube videos, anything but giving myself the opportunity to think about it. Second one is getting yourself into new hobbies, which is extremely easy. I've never been a car guy or anything but cars generally interest me, so I started following Formula 1 closely. Got myself a 3D printer and started studying 3D modeling. Microcontrollers, sensors and small devices are dirt cheap and making small devices is extremely rewarding. And last but certainly not least, when the pandemic started I got myself a dog to keep me company. A fairly large one and a breed that is notorious for being extremely smart and having an infinite amount of energy. I definitely underestimated both of those things but it has helped me massively.