The gear hanger, or bike dropout is a small tab of metal on the drive side of the bike near where the rear wheel is anchored in the frame. It is easily bent in a crash. If the frame is made of aluminium it's not possible to bend it back safely. To avoid writing-off a whole frame in a minor fall aluminium frames for derailer bikes have gear hangers that can be detached and replaced.
Remove the back wheel.
Unscrew the rear derailer from the bike dropout. It may be easier to dismount the gear-cable before you do this.
Unscrew the bolt, or bolts, that hold the bike dropout to the frame.
Type Of Bike Dropout
There are many different shapes of replacement hanger so you need to keep the old one for reference. A good place to start is the shop where you bought the bike, or a dealer who sells the same brand of bikes. It’s also helpful if you know the year, make and model of your frame.
Once you have a replacement bike dropout bolt it on in the same position.
Screw the rear derailer into the bike dropout.
Remount the gear cable.
Replace the rear wheel in the bike.