I am the same. When alone my mind fixated on the bad stuff. My psychotherapist told me I need to go out and do stuff and I need a routine. An exercise or mindfulness class is good as it gets you out and helps with mh (note to self, I must go back to tai chi). Sometimes I find I can lose myself in a good film and stop the racing thoughts. Do you have hobbies. Basically when lonely you need distraction techniques.