To change a violin string you need to be really careful so that you do not break your new string that you're trying to replace in the first place.
Step 1: Removing the Broken String
First off you need to make sure you remove the broken string of your violin completely, before you attempt to install a new one.
Step 2: Putting the String in the Peg
Then you need to make sure to put the right end of the string into the peg, then carefully put the string into the peg hole and carefully wind it just don't do it too tightly or else you might make the string pop and you'd have to buy a whole new one.
Step 3: Tuning the Finished String
once you've put the string in the peg and you feel its tight enough make sure to tune it and if you've done everything correctly you should be done.