An instruments string nut, commonly called simply “the nut”, is a piece of hard material used to support and position the strings.
It is located at the end of the fingerboard, closest to the headstock. It marks one end of the vibrating length of the strings. (The saddle serves a similar function on the opposite end.)
In addition to supporting the string, the nut sets the spacing of the strings across the neck and typically holds them at the proper distance above the fingerboard.