How to feel less sad and lonely at night while boyfriend is overseas?

Many ways. You can put things that remind you of his presence in bed such as his shirt and blanket. The familiar smell would make you feel more secure. If possible, talk to him on the phone or listen to his voice (tape recording) before bed may help with the sleep. If you sleep better, you would have less time to feel sad and lonely. Hope things get better soon!
Gratitude. Sadness is a sign you have not accepted where you are - replace this with gratitude for being given a challenge you can work with. Sadness is victim thinking serves no purpose and drains you. Gratitude is a choice thinking. Replace sadness with prayer and visualize a dinning table and see yourself and your boyfriend together - create a sacred space and energize this space daily. It will materializ.