Buy new sprocket. This might require counting the teeth of the existing one if you've
forgotten.
Stop. Get off the bike. Get your tools.
Remove rear wheel. Notice the chain kept in place hooked over the derailleur appendix.
Unscrew sprocket. The loose bit of dangly chain is looped over the gear so that gravity
keeps it in place as you heave. The red lever in both the pics is being pushed down.
Continue to try to unscrew sprocket.
Grunt a lot and finally manage to unscrew sprocket. Thick leather gloves highly
recommended.
Apply bandages to where you grazed your knuckles on the spokes unscrewing sprocket.
Clean and lube hub thread and new sprocket thoroughly.
Screw on new sprocket.
Clean, oil, and store old sprocket.
Replace wheel and chain.
Go for a ride.
Make a conscious effort to crank hard and take in a couple of hills to bed the new kit in.
Hope very much you didn't pick a tooth count that really is too hard.
Approximate time required: about 20 minutes after the third or fourth go.