How to take apart this rear BMX hub? As shown in the photo, what tool do I need to take this rear hub apart? I assume I need a tool which will fit in the 4 notches.

The problem I am trying to fix is that if you pedal, the rear cog spins but does not turn the rear wheel. Any pointers on that would be appreciated. I guess I will find out the problem when i see inside.

Thanks!
You'll need a freewheel removal tool like the Park FR-6
http://www.parktool.com/product/freewheel-remover-FR-6

You can attach that to the freewheel and then use a wrench to remove the freewheel.