Loneliness and being alone are two quite different states of mind.
Being alone
Some people and indeed some children choose to be alone. They may be shy or simply not enjoy the company of being with others. Often the isolated child is a cause for concern for
teachers and parents but not to the child themselves. A child that has a healthy self esteem is not at risk simply because they choose not to socialise with their peer groups.
I know as a child I was often isolated by situations such as my father not allowing us to have the phone on or have other children over to visit. Whilst that caused quite a few issues; I was never lonely as a child because I had and on occasion still have a gregarious nature and was able to draw people to me. To say I could talk the leg off a table, underwater with a mouth full of marbles is an understatement and I think because my time was so limited with my school peers I had to make sure I had 4 hours of talking condensed into 1 hour of lunch and recess. As a person who works with children on a daily basis I have noticed the ones termed social isolates, those students who aren't mixing with others. My advice is the following:-
Ask
Ask your child why they are not socialising with others, if they have a valid, plausible reason accept it as such. Valid, plausible reasons are those where they identify the traits that make their peers unacceptable to them as friends, it could be meaness, their inability to share, their siding with one peer over another or any of 100 other valid or plausible reasons to them.
Children are very good judges of character and maybe they are choosing not to befriend someone or a group of peers that conflict with the values and beliefs of their home. It is a very different story if they are isolated because of others or an inability to interact with their peer group which I will discuss later.
Ask what your child does during the breaks, if they are doing homework, visiting the library, reading a book and are happy to do so let them be. Are you aware of break times, where I am currently its 2 x 20 minute breaks for most kids its just enough time to eat and go to the toilet.
Sport
Sport is a great way to introduce those children to new peers that may be outside the school environment, just because your child attends a school doesnt automatically mean they have to like everyone in it. As adults we accept that we can't like everyone and that its perfectly OK not to be friends with certain people, why then do we expect our children to embrace all others? Sure its good to be able to get along and for many children they have the ability to get along when they have to just as adults do, working together in class is one example so if they are choosing not to invite friends over ir to interact with them when they aren't required to let them be and allow them their space.
If they are those few who chose to be alone then consider sports they can still enjoy, swimming, golf, bowls (don't laugh a lot of young people are getting into it) Ten pin bowling, Darts infact any sport or activity that isnt reliant on teams will help the person who choses to isolate themselves meet people of like natures.
Inability to interact
This is a different situation, these children require assistance and some very good advice has been given on Minty in regards to this such as modelling conversation starters. It may mean coaching your child to share, to listen, to be less rough with others. It may mean sessions with the school counselor or chaplain who are people not to fear but to embrace as part of the school community who have strategies to assist students who are experiencing difficulty with their peer group for a variety of reasons.
Loneliness
Loneliness is a state of mind, you can be alone and not be lonely. On the other hand you could be in a crowded room and feel loneliness. This is a very different situation and a person experiencing this needs to be encouraged to pursue things of interest with themselves and others. Loneliness can stem from an inability to reach out to others and may require counselling to develop strategies to connect with others.
What to encourage
Active minds - read, read and read books open all sorts of doors to all sorts of people.
Engage your child in conversations where you listen to what they are saying. Don't belitttle their ideas, beliefs or values explore them with 'what if' questions and respect their answers.
If they are passionate about a hobby find local community centres who share the same activities.
Remember they are individuals and often following the pack isnt the best option.
If being alone or peer isolation is causing problems seek help, its ok to say I dont know how to deal with this situation and I need some strategies to do so, and its OK to encourage this in your child.
Whatever you do don't add pressure to your child this will only serve to make them feel different, that they choices are unacceptable or there is something wrong with them when it may not be the case at all. Remember children mature at different rates, they are able to make many decisions for themselves and they need to be happy with their choices.