What can you do when the day is close to ending and you feel lonely?

I mean.... sometimes I feel like something's missing. I know I could always just focus on my mission but right now I just wanna sleep peacefully, without these agitating thoughts.

Am I condemned to simply have bad nights every now and then? Can I work around this? What is it that's missing, since, moments before, I was satisfied with myself and my journey and would be happy to die alone?

What do I do when feeling lonely?