“Enter Sandman” was written first for the sessions that produced Metallica's The Black Album.
The song was the first composition developed for the album, although it was the last to receive its lyrics. That unusual sequence helped shape the track: its central musical idea was established before James Hetfield completed the words about childhood nightmares and bedtime fears.
Kirk Hammett brought an important guitar idea to the writing process, and the final song was credited to Hammett, Hetfield, and Lars Ulrich. The collaboration produced the riff-driven sound that became the album's most recognizable musical statement.
A common misunderstanding is that the song was simply recorded first because it opens the album. In fact, the writing order and the final track order are separate matters. “Enter Sandman” happened to be both the earliest written song and the opening track.