The most basic thing you can do to help you concentrate in class is to get away from the distractions that are keeping you from focusing. There are lots of things that might be taking your attention away from the lesson. Try to be more aware of what you’re doing when you stop paying attention. Once you know what it is, you can find a way to get rid of it.  Distractions include items like a computer, a phone, and small items that you can play with. Distractions also include things that are around you, like a friend, an annoying classmate, or a window. Physical removal is the best way to deal with a distraction. So, for example, if you know a classmate is distracting you. Try sitting somewhere else. Your teacher will understand and will probably be more than happy to help you move seats. You have to try to keep your brain from wandering out of the classroom. No daydreaming! Keep your mind here, in the present and save thoughts about other stuff for later. This is hard to do but if you can make the change, it will really help you a lot.  Things you might catch yourself thinking about include: games, what you’re doing after school, your boyfriend or girlfriend (or lack thereof!), your friends, your family...even fantasy stuff like books you'd like to read or places you wish you could go. You’ll have to learn to manually refocus your attention. Catch yourself and then make yourself think about the lesson again. Eventually it becomes a habit and you learn to daydream less. This means that even if you’re thinking about another aspect of the class, like the test you have coming up, you’ll want to stop and refocus on what’s happening right now. It’s important to do things like think about tests but if your mind is wandering then you’re not absorbing the information that you need to learn at the moment. Pay attention to what your mind is doing. If you catch yourself thinking about anything other than what’s currently happening in the lesson then you’re going to have to manually refocus your attention. Try saying back...

TL;DR in Chinese:
远离干扰。 关注此时此刻。 重新集中注意力。 和老师交流。 给自己动力。