Turn off power
Safety comes first. Power must be disconnected before attempting any change to the circuit. It can be achieved by turning off the circuit breaker for the room/area where the socket needs to be replaced. The Circuit breaker will be found in the Circuit breaker box, and if there is trouble identifying the right breaker in the box, an easy alternate is to turn off the main circuit breaker.
Check again for power
Use a flash light to distinguish live wire from the neutral one. Black one is the live wire. Test these wires with a tester.
Pull out socket
Pull out the socket gently with its edges. Make sure not to touch the naked end of the wire. Touch the tester to the naked wire to double-check that it is disconnected from the circuit.
Understand colour coding
Black wire: It is the hot or live wire. They are attached to the outlet with the help of brass coloured screws.
White wire: It is the neutral or cold wire. It is affixed to the socket with the help of silver coloured screws.
Sometimes there will be a third wire present. It will be green in colour and will be attached to the socket with green coloured screws.
Remember the wire configuration
Take note of the configuration. No matter how simple it looks, once the wires are unscrewed a lot of people tend to forget the right order.
Matching the size and the current rating
The new outlet should be exactly same in size or it will not fit. The current rating of both the outlets should also be same.
Installing the outlet
Screw the new wires in the exact same pattern. Naked end of the wires should be sealed with a solution tape. Gently push the outlet back in and screw it up.