A cracked or broken windshield needs to be replaced immediately. There are two basic ways your windshield glass could be attached to the car. It could be sealed onto the frame underneath an outer trim, or it might be held in place with a rubber gasket. It's always a good idea to check with a mechanic or other expert to see how your car's windshield is installed and what method is needed to replace it.
Preparation
Any objects that are attached to or near the window must be removed beforehand. This mainly includes the wipers and the rearview mirror. The mirror is usually screwed onto the glass from the inside, requiring a hex or allen wrench to disconnect it. The wipers usually require a standard flathead wrench for removal; you may also need to rock the wipers back and forth to disconnect them. You will naturally reinstall these after the new glass is in place.
Glass With Sealant
To remove the outer trim surrounding the glass, you need a special tool designed for this task that most auto supply shops should have. Insert the forked end of the tool under the trim and carefully disengage the clips underneath so they can be used again. Once the trim is removed, cut away the seal affixing the glass to the frame. Another special tool is designed for this, which requires you to insert its blade underneath the glass and slowly cut away at the sealant, making sure you don't break the glass. There are two ways you can remove the glass from the windshield frame: Pull it out from the outside with a large suction cup, or push it from inside with your foot and a large stick--don't kick the glass. Have another person available to catch the glass. Scrape away the remaining sealant with a chisel and sand away any rust along the frame. Attach the outer trim to the new glass first using the clips. Apply new sealant to the windshield frame, applying it in a V- or triangle-shaped pattern. Carefully lower the glass onto the frame, making sure it is properly centered in the frame. The sealant should take a full day to harden; tape down the glass with strong masking tape while you wait for it to harden.
Glass With a Gasket
Inspect the gasket's condition; if it isn't dry and/or hardened, you could use it again. Otherwise, cut it away with a carpet knife or similar blade. Plunge the blade into the rubber gasket, making sure you don't hit the glass, and carefully cut along the circumference of the glass. You can now remove the glass by pushing it out from inside the car with your foot and a large stick; have someone catch the glass from outside. After cleaning away any rust and debris from the frame, apply sealant to the inner edge of the gasket and attach the gasket onto the new glass. If you're using a new gasket, let it sit in the sun for up to an hour to soften; if the weather outside is cold, let it sit inside in a warm room and just make sure it is pliable. Apply petroleum jelly to the gasket's outer edge and run a nylon rope around that edge, making the rope ends meet at the bottom. Have your assistant lower the glass onto the frame and press on the gasket while you grab the rope ends from inside the car and pull on them, pulling the gasket's inner lip inside the car.