Tools needed: Bike stand (optional); Allen keys (various sizes)
Fitting the shock
If you have one, secure the bike in its stand.
Start by attaching the shock to the frame by its upper mount (ie the one not connected to the swing-arm), making sure to include any spacers, washers etc that you removed.
Lift up the swing-arm, rotate the shock so that it lines up with its mount, and secure it, including washers & spacers if you used any.
Check your sag, compression and rebound are set correctly, and go ride!