Guitar strings do not always want to stay in machine heads. Sometimes they slip, sometimes they snap, and they never hold tuning. If you change your strings regularly, you probably don’t have this problem, but occasional players just don’t seem to be able to keep this little trick in mind. Watch how it should be done to ensure that your strings remain in place (I didn’t make this video, just
This goes for both acoustic and electric guitars, except the part where you fix the strings on the bridge, which is different but not difficult. No tricks here, you’ll figure it out all right.
Just one more thing: before you fix a string on the peg, leave a slack of some three or four centimeters before you start twisting up. Otherwise, if you do it exactly as the video shows, your strings might slip.