Look around the perimeter of the carpet for carpet staples. You may have to dig through the nap a bit to spot the flat silver staples. Remove the ones you see along the edge of the wall. Wedge the edge of a butter knife or other long, thin metal object underneath the staple to pry it up. Then use a pair of needle-nose pliers to pull up the staple.
Feel along the edge of the wall for a tack strip. Tack strips are thin pieces of studded wood or metal that are nailed to the floor. If you feel a tack strip, run a utility knife along the "gulley" or space between the tack strip and the wall. This frees the carpet from its attachment to the edge of the floor. If you don't want to cut the carpet or there's no tack strip, skip this step.
Start at the corner of the room. Try to pull the carpet up and away from the wall with the help of a pry bar. Alternatively or in conjunction with the pry bar, use needle-nose pliers to grip the carpet by the nap or edge and pull. If you've scored the carpet along the tack strip, pull up the strip of carpet next to the wall with the help of your needle-nose pliers. Continue pulling the carpet in this manner all along the perimeter of the wall.
Pry the tack strip out of the subfloor with a pry bar. Place a sliver of wood between the pry bar and the floor to protect it from scuffing. Take care as you work. Sharp nails stick out of the tack strip.