look a very easy way,
first,know about whole note and half notes,like the distance of two frets is called whole note distance and one fret is called half note distance.
like the distance between 1st and 3rd fret is whole note distance, and 1st and 2nd fret is half note distance.
so a major scale goes like this.
(the starting note is called the root note)
like i start on the first fret of the thinnest E string
it will be a f note. so the scale is a f major
here are the frets.
and a minor scale
and whatever be the starting note or root note it becomes the note of the scale.