To replace a toilet flange, you need to follow these steps:

1. Turn off the water supply and empty the toilet tank.
2. Remove the toilet and the old wax ring.
3. Loosen the flange's screws and pull it out or break it off with a hammer and chisel.
4. Insert or install the new flange in the drain line and secure it with floor bolts and toilet bolts.
5. Place the new wax ring underneath the toilet and align the bolts to the holes in the toilet base.
6. Reattach the water supply hose and reassemble the toilet.

Here is a step-by-step tutorial that you can follow for more detailed instructions . You can also watch this video tutorial or read this article for more information.

I hope this helps!