Just to be clear... as other have mentioned
Old style freewheel.
You hold the wheel and unscrew the entire Freewheel (with cogs) from the wheel
You must not use a chain whip! - you will be holding the same assembly you're attempting to unscrew.
New Style cassette
You hold the cassette cogs with a chain whip and unscrew the cap.
The cogs then slide off of the freewheel that remains attached (and is part of) the wheels hub.
Reassembly... the Cassette cap has to be torqued to the correct value, the old style freewheel tightens when you ride it.
All the best
Barry