This maintains the tension on the instrument and you will have less trouble retuning because the guitar does not have to stabilize again. Secure the new string at the bridge. Acoustic guitars, remove string peg place ball end of string in hole and replace peg firmly. Pull the new string until firmly anchored.
Electric guitars pass the strings thru the tailpiece or tremelo block and over the bridge.
Pass the string end thru the tuning peg on the headstock and wind around the peg 2 or 3 times and turn the tuner away from you to tighten the string to pitch. Rather cross the string over the previous wind on the peg. This will effectively lock the string to the peg and prevent slippage. New strings will stretch for some time, until they are 'settled in'. You can speed up the process by playing a series of bends up and down the neck on each string and by gently pulling the strings away from the fret board.