To get the job done use the right tools.
In order from left to right chisel, large putty knife (used for scraping dry underlay off floor) staple lifter, tack lifter, hammer and pliers.
Mask and gloves
The carpet grippers
Looks worse then the photo, carpet, underlay, grippers, staples and nails now removed