The terms alone and lonely are often used exchangeably and that is causing a lot of confusion, because there’s a big difference between aloneness and loneliness. And I’d like to add a third form: solitude.
Being alone, as in: there are no people around you, is ALONENESS. It’s neutral and actual.
Spending time alone, with yourself by choice, is SOLITUDE. It’s positive.
If you would (for whatever reason) not be happy being alone, that would be LONELINESS. It’s an emotion and negative.
Being alone is something you are, lonely is something you feel.