The third and final step of setting up your guitar is to cut the slots in the string nut to a depth
where you get the optimal first fret clearance for each string. Rather obviously, you want that
clearance to be as low as possible, because the higher it is, the more your fingers will hurt
when fretting the strings at the first few frets. Moreover, the intonation of your guitar will suffer
(that is, your chords will be off even with perfect tuning) when the strings are two high above the
So if we want the strings to be as low as possible on the nut, then what is the lower bound? One constraint is of course that the open, unfretted strings should never buzz on the first fret. However, there is another thing to be kept in mind: raising the strings at the nut will also prevent the behind-the-fret buzz that I mentioned earlier. Therefore, your ideal first fret clearance is usually a tad more than what you would absolutely need to prevent the open string from buzzing. That is true especially if you prefer less neck relief. My preferred values for the first fret action are .022'' for the sixth string (that's the deep E, the wound string) and .018 for the first string (that's the high E, the thin unwound string), with the rest of them pretty much evenly spaced in between.
When you buy a new guitar, you can almost be guaranteed that the nut slots are not deep enough. I have seen expensive guitars that came with as much as .035'' of first fret clearance, truly a finger killer. To cut the nut slots deeper, get yourself a good set of nut slot files, e.g. from Stewart-MacDonald. For each nut slot, select a file that is as wide or a tad wider than the diameter of the respective string. (Making the slot too narrow will cause the string to bind in the slot, with very unpleasant consequences.) To work on a particular slot, take off the respective string, but make sure that all the other strings are on and tuned up, so that the neck is pretty much in the same position as it is normally when you play. Then cut the nut slot deeper with your file, angling it downward a bit towards the headstock.
Blow the dust out of the slot,
put the string back on, and take another measurement.
Needless to say, you want to do all this in many, many tiny iterations so that you don't cut the slots too deep. When I said earlier that performing a guitar setup is not hard, I didn't mean replacing the string nut. That can be done, but it poses challenges and should not be attempted unless you know exactly what you're doing. Some people say that you can also fill in a nut slot that's too deep with a mixture of glue and filing dust, but quite frankly, that combination of messiness and subtleness is too much for me to even want to attempt. Just be careful and don't cut the nut slots too deep. In particular, make absolutely sure that you have performed and double-checked the first two steps of the setup, neck relief and saddle height. If you do the nut slots first and then later have to decrease the neck relief or lower the saddle, your strings will be too low at the first fret, that is, your nut slots will be too deep and there you are in the deep doo-doo that you worked so hard to avoid.