Use the razor knife to cut the carpet into smaller, more manageable sections. Cut into as many small sections as you want. If the carpet has been damaged by a lot of moisture, smaller sections will give you more control over the carpet, since it will not hold together very well as it comes up.
Lift the pieces from the center of the carpet. More glue is often applied at the edges, and removing from the edge can cause the carpet to tear unpredictably.
Remove any stray pieces with a sturdy scraper.
Clean off the old glue with an adhesive remover. Wear protective gloves. Wear a respirator if you are using a remover that gives off toxic fumes. Rubbing alcohol and mineral spirits (paint thinner) can remove many adhesives, and toxic chemicals might not be necessary.