Lay a tarp down inside of your home directly under the skylight.
Climb up to your roof using a ladder.
Unscrew the screws that line the frame of the skylight using a Phillips screwdriver.
Lift away the top frame from the glass and slide the locks over that hold the glass in place.
Lift out the glass, including the gasket, and set it to the side.
Attach the new gasket to the new piece of glass by sliding it over the edges of the glass if the glass does not already have the gasket in place.
Lay the new piece of glass down into place in the frame.
Replace the frame, and then screw it back into place.