“Lonely” is the state of being avoidant and discontent with yourself—an indication that inner work is required.
“Alone” is the state of being present and content with yourself—a healthy indication of inner acceptance.
The transition from lonely to alone will vary in difficulty one person to the next.
But, in each case, when we start small and commit to incremental increases in things like journaling, meditating, solo walking, etc… we can slowly head in the direction of alone.
Which, is an imperative direction to head as being without people will only increase as we grow older. Better to learn the skill now and acclimate before you’re thrusted into the position, unprepared later.