Demotivation needs to be handled carefully, as it often hides other problems. Added to this, you are guessing that the students are demotivated and this may not be the case.
It's important to talk about the reasons for the perceived demotivation. If the class are used to giving and receiving feedback, then the discussion can be done as a whole class. If not, you could have individual tutorials. You could also incorporate a class test, followed by an individual discussion of progress and use that time to discuss their feelings about the lessons. This can be in their mother tongue, if they are not of a level to do it in English.
Be careful to focus on your perceptions of their behaviour, not their personality and try to avoid judgements. For example, don't say "You're not motivated in class. Why?". Try asking them what they think about the lessons and their progress. Then say something along the lines of "I sometimes think you are tired in class. I might be wrong. What do you think?" "I think you participate in some activities more than others, is there any particular reason?". In the first, you are focussing on your perceptions and checking their validity. In the second, the focus is on observable behaviour. You're not talking about their personality.
Focussing on tiredness and participation will open more doors than discussing lack of motivation. These questions could also uncover other problems, eg they don't understand what is being done and so can't participate. As I said before, they may be motivated so talking of their lack of motivation could make them defensive. Listen carefully to what they say, be open to suggestions and try to avoid being defensive yourself. Teenagers will appreciate the fact that you listen to them and take their opinions seriously. You also need to be clear about your expectations from them. Let them know gently but firmly, that you want them to participate more fully. I often find that students are aware of the situation and realise that it needs improving.
If you haven't already done it, now might be the time to establish class rules. This could be done in the form of a contract that is negotiated with the class. Facing up to the problem is the first step and talking about it openly usually clears the way for improvement.
It is also a good idea to work on group dynamics. Try to do an activity that takes them out of the school. If this isn't possible, try to have them interview other people in the school (teachers, admin staff etc). Organise this in groups. Getting them out of their seats and interacting with other people as part of a team can bring together a group.
Whenever you can, do work with them standing up and moving around. This can easily be incorporated into any class. For example, when giving instructions for an exercise instead of doing it orally, write the instructions on pieces of paper that are pinned up around the classroom. They move around to find out what to do. Physical activity keeps our minds and bodies active. You can also look at my reply about dictations.
At all times, hide your frustration with the students, remind them gently of your expectations and insist on the contract being respected. I think you'll see a change in the dynamics pretty quickly.
I guessed that the students were teenagers, not sure if this is right. If you want more ideas, you can write in again.