Come to class prepared. Do all the necessary readings the night before. Write down any questions you have from the readings, this will give you the opportunity to get them answered in class. Make sure you show up to class with your notebook and a pen or pencil. You don't want to be wasting class time asking people to borrow theirs.
Come to class ready to learn. Limit any distractions and focus on what is being taught in class. Turn the ringer of your phone off and keep it in your bag, keeping your phone out of sight will ensure you wont be tempted to look at it. If you like to chat, don't sit beside your friends. Focus all you can on your lecture, there is always time to talk after class. Sit up front and center in the class where you are guaranteed to see and hear your professor.
To ensure you remain engaged in class always participate. Your mind will remain alert and focused. You'll also remember more from the class as you're engaged in a conversation.
While in class take notes, this will keep you engaged in class. As you take note you'll be less likely to be distracted by other sources. You will remain focused on what the professor is saying and you will have proper notes to use when you're studying.