Identifying the note set for the song you are playing connects the practical playing part to your theory and musical understanding, reduces mistakes from your playing, improves your note finding abilities.
The note set you find – as alphabetical notes or fret/string positions – is the scale of the song.
Examples of finding and writing down the scale:
Scales are patterns. The pattern is the scale, the notes used in the song.
Beyond somehow playing, when you start realizing underlying patterns, constraints, note sets, you can make better guesses when finding notes on your own.
Start by trial and error, note down the notes you find, see a pattern emerging. Extra notes are added to the initial find, verified if really true.