To string a guitar, any guitar, the first step is to secure one end of the string to the bridge. Once the strings are securely attached to the bridge, you can focus your attention on the headstock. On a nylon-string guitar, the tuning posts (called rollers) pass through the headstock sideways instead of going through perpendicularly, as on a steel-string acoustic or electric guitar. This configuration is known as a slotted headstock.
Pass the string through the hole in the tuning post.
Insert the string through the front and out the back.
Bring the end of the string back over the roller toward you; then pass the string under itself in front of the hole.
Pull up on the string end so that the long part of the string (the part attached to the bridge) sits in the U-shaped loop you just formed. Make your loop come from the outside (that is, approaching from the left on the lower three bass strings, and from the right on the upper three treble strings).
Pass the short end under and over itself, creating two or three wraps.
Doing so should hold the loose end firmly in place and prevent the string from slipping out of the hole.
Wind the peg so that the string wraps on top of the loop you just formed.
This will force the string down against the post.
Pull the string length taut with one hand and turn the tuning peg with the other hand.
Wrap the windings to the outside of the hole, away from the center of the guitar.