The first thing you need to do is cut off the water supply to the cistern. Flush the cistern a couple of times so that it completely empties. If you are replacing the cistern and the WC, you might be able to get the whole thing away from the wall in one go, but it is better to remove the cistern first, before tackling the WC. Disconnect the supply pipe and the outflow pipe and then unscrew the large nut connecting the flush pipe to the bottom of the cistern. If this is corroded, you can simply hacksaw through the pipe close the connection.
Lift the cistern off of its support brackets and attempt to unscrew the fixing screws. Often, especially in very old systems, these will be heavily corroded and you may need to simply lever the screws out of the wall with a crow bar. Chisel away the plaster around the overflow pipe and remove it from the wall. This can be filled and repaired once the new WC is in place.
If the WC pan is screwed to a wooden floor (as it is in most cases), unscrew all of the fixing screws at the base of the pan and scrape out any putty around the pipe joint. You can now try disconnecting the pan by pulling it towards you. If it will not move, you can smash the pan outlet just in front of the connection to the soil pipe (making sure you wear some goggles to protect your eyes). The pan should now lift out of the way. Stuff some rags into the top of the soil pipe to stop any debris falling down it, and then chip out any remaining pieces of the pan outlet which are stuck inside the soil pipe. Be sure to remove the rags when this is done.
If you have an s-trap (the pan outflow points down into the floor rather than horizontally out through the wall), you can smash it free of the soil pipe in the same way. If the pan is cemented to a solid floor, work a cold chisel under the base until the seal is broken. You will then be able to lift the pan away from the floor. Chisel out any broken fragments and clean up the floor surface with a cold chisel.
Breaking and Cutting the Soil Pipe
If you break the end of the soil pipe when removing the pan outlet pipe, you will need to cut the end square before you can fit any replacement WC. For this you should use a Chain-Link Pipe Cutter. These can be hired very cheaply if you do not already own one. Clamp the chain cutters around the pipe and work the shaft back and forward to cut the pipe.
Connecting a New WC to the Soil Pipe
Before you install your new WC, make sure you have a push-fit flexible connector to join the soil pipe to the new pan. You can buy connectors in numerous styles and colours to match your WC. Make sure you measure the inside and outside dimensions of the soil pipe and pan outlet, as well as the distance between the end of the pan outlet and the end of the soil pipe.