Lay your back and butt on the bed with your legs extended straight up toward the ceiling. Place your hands underneath the back of your head.
Pressing your lower back into the mattress, slowly lower both legs down toward the floor, then slowly raise them back up. If this is too difficult, lower them as much as you can, or lower one leg at a time.