Loneliness is not about being alone. It is about not being properly connected. The emotion behind loneliness is sadness, but loneliness is a spirit that creates a perception of an inward emptiness. That is why people who suffer from loneliness can feel alone even when they are with people who love them. The spirit of loneliness prevents proper connections with others and with God.
The good news is that God has provided a way for healing and provision for us to experience joy in fellowship with Him, joy in fellowship with other believers, and joy in active service with others.