Find a spot where you won't get noticed by the teacher or other students, as best as possible. Make sure there is a friend near you to wake you up if necessary.
The "I Dropped Something" Method: Place a pencil on the floor near your desk on the right side. Place your left arm horizontally on the edge of the desk. Put your forehead on the arm. Let your right arm flop down as if you are reaching for the pencil.
The Book Method: Set up your left arm in the same way as the last method. Open a book and place it on your lap. Place your head down on your arm. Place your right hand on the pages.
The Book Method #2: Place a hardcover book on your desk opened to the very middle (so the pages don't turn themselves.) Put your elbows on your desk next to the book with your forearms up. Using your hands shield your eyes like a sun visor/ baseball cap.
Book Method #3: One very comfortable way to sleep in class, assuming them teachers does not care if you sleep, is to simply put a book flat on your desk, and rest your forehead on it. While doing this it is important to just keep your arms relaxed in your lap. The downside to this method is it makes it quite obvious you are or are trying to sleep. The major benefit of this method is that it doesn't cause your arms or any other part of your body to "fall asleep" (no pun intended), thus allowing you to sleep longer without being awoken by your arms tingling in discomfort.
The Desk Method: Put your arm and head in the usual positions. Reach inside your desk, as if you are rummaging for something
The "I'm taking notes method": Place some paper or notes, preferably with some writing on them, on the table. Place your left elbow on the table and rest the corner of your forehead on the heel of your left palm. Face your head downwards so that you are looking at the edge of your desk. Hold a pen in your right hand to the paper in front of you, as though you were writing something. Also, you can adjust your seat so that you tilt your head and body away from the teacher as much as possible. Switch hands where necessary so that the arm you're resting on shields you from the teacher.
The I'm-Reading-Under-The-Desk-Method. Place a book open on your lap, fold your arms on the desk, and put your head down so it looks like your reading your textbook. Answer a couple questions while in this position before you g o to sleep, so your teacher thinks your awake and paying attention.
Grab a book and put in standing up on your desk shielding your face from the teacher.
Try to cup your face if you are reading something. To do this, cup your hands around your eyes and rest your chin in your palms.
The long hair no-fail method: If your teacher stands in one place, and you have excessively long bangs, put them in front of your face about a few minutes before you decide to sleep. Then, fold your arms on your desk and rest your chin on your arms so your face is facing the teacher. As a variation on this method, if you are allowed to have a backpack or large bag during class, place it on your lap and fold your arms over it as if you are hugging it. Rest your head on top of the bag, instead of the desk, as this gives you a more upright posture, and looks less suspicious. Sweet dreams!
This method only will work on a computer(computer class, technology ect.) open a "important" webpage, place on hand on the mouse, one hand on the keyboard and slowly fall asleep.