Everyone whose ever rode a BMX bike has wanted to do a backflip, it impresses kids, it looks dangerous, and it's the coolest a grown man can look on a little kids bike... the thing is they are really easy, and once you have done one, it can be even safer than doing one on say, a trampoline.
Be really comfortable on a BMX. It's best if you have been riding a few years and have other easier tricks like 360s down first, so you know how your bike likes to move.
Adjust the flip for a nice landing, but for starters get a good 4–5 feet (1.2–1.5 m) of air. It's easiest to learn on a 5 foot (1.5 m) ramp, not too steep, and not too mellow.
To give you an idea of how you want to pull off the ramp, picture you are on a roller coaster going through a loop. You know how you're looking ahead with your head back too see where you're going? That's exactly how you flip.
Try taking a few practice runs, going as fast as you're planning on going for the real one. Then get a feel for the transition of the ramp pumping into it, and starting your rotation then taking your feet off and landing holding your handlebars.
As you approach the ramp, pump into it, pushing forward into it, going with the transition as if you were trying to pick up speed. This gets your rotation started and really is the key to flipping. Pump hard into the ramp, and picture like you're going through a loop on a roller coaster.
Now you're off the lip, flipping upside down. No matter what happens, don't let go until you can see the landing! If you go off the lip starting a flip and let go right away, your body will keep rotating and your head and back are going to hit the ground harder than you have ever hit it before, and to top it off the bike could land back on top of you. If you hold on, even if you don't make the full rotation, you're only falling from 4–5 feet (1.2–1.5 m) up, you might get banged up but you're much better off.
If you go completely around on the rotation and you see the ground, it will happen faster than you can think, but just land. It's that simple. Your body will usually correct small imperfections in your rotation automatically and as long as you judged your speed right, you're about to roll away from your first flip! Now if you went too fast, or rotated too quickly (which is pretty easy to do on a new ramp), you may over rotate. This may sound scary, but it's usually no big deal. If you feel you're over rotating, once you see the ground, take your feet off and ditch the bike. 9 times out of 10, you are going to land on your feet...just go a little slower or pump into the ramp a little less next time.
Now if you went too slow, or didn't commit to the flip enough and you under rotated... good luck, odds are your front wheel is going to land first and anything from having sore wrists from the front impact, to landing in a tangled heap on your bike can happen.
Next try pumping harder into the ramp going off the lip, this will speed up your rotation and get you over rotating, or landing on your wheels.
Wear pads, all of them, every time you ride your bike.