Time and again throughout the Old Testament, we find the Lord reaching out to His people, revealing Himself to them, desiring to be with them and to communicate with them.
1 Samuel 12:22
For the Lord will not forsake His people, for His great name's sake, because it has pleased the Lord to make you His people.
God desires a relationship with you in companionship, fellowship, and communion. We can count on the Lord, even if everyone else abandons us. So when loneliness engulfs us, the first thing we must do is turn our focus away from what we don't have to what we do have...God Himself!
You can never be alone once you have trusted Jesus as your Savior. He promises that He dwells within you when you have received Him into your life and that He is connected to you, just as a vine and a branch are connected. Although the depth of that intimacy, to a great extent, is up to you. How much intimacy do you desire with the Lord? Even so, He is always there, desiring to move ever closer to you.