This from my scuba divin' days...
Do
not use anything metal, or sharp, to pry the o-ring out. You don't want to scratch or score the o-ring in any way. There is probably a specific tool for the job, but a nylon spudger works well and is relatively safe on the o-ring. A whole kit (which is a handy set of tools to have around) is cheap on Amazon:
https://www.amazon.com/dp/B01F52ZPB...&pd_rd_r=2d293897-b776-11e8-93c3-43ef3083dbae
Sometimes you can pinch them out if you don't want to get the tool (as Jason described). You pinch your fingers along the direction of the ring (not perpendicular to it). Sometimes that'll bring up enough of a loop to then grab it with the other hand.
Once removed, clean the two surfaces it touches thoroughly (one on the lid, the other on the pump). This is usually neglected by most of us, but a good leak prevention tip. It doesn't take much crud to foil an o-ring. I use a lint-free cloth, so that it doesn't leave anything behind.
Then wipe down the o-ring with the same cloth to clean it.
Put some lube on your thumb and rub it across onto your forefinger. Pinch the o-ring between the two and pull it around and around a few times to coat the entire surface with lube. (You washed your hands first, right?) You don't need to slop it on, more won't be better. You're just making the o-ring "wet" with lube. The lube doesn't create the seal, it just allows the ring to seat within the two surfaces without pinching itself out of shape as you tighten the lid.
Reassemble. Test. Done.