Turn your bike upside down, use a socket to loosen and remove the nut. After the nuts are removed derail the chain off the sprocket and take the entire wheel off the fork. Then the sprocket will come off.
You will normally need a special tool to do this. If you just need to do it once, sweet talk your local bike mechanic into helping you out. If you will be doing this often, buy the tool that fits your particular sprocket.
You need several special tools: specially a "Cassette cog remover". The cogs are fixed to a 'hub'. You first have to determine the kind of hub that is used on your bike. Also you need a Sprocket Tool (chain whip)and a Freewheel tool wrench.