Opening your Biblia Hebraica Stuttgartensia (BHS) to page 1105 you notice Psalm 23:1 at the bottom of the page.
Scanning the first verse you notice the two raised circles in the verse. One above the phrase מִזְמ֥וֹר לְדָוִֽד (a Mizmor of David) and one above רֹעִ֗י (my Shepherd). The first circle alerts you to the Masorah Parva (the ancient abbreviated Masoretic reference notes on the side of the page in a codex now reproduced in the BHS). The note reads as follows ח̇ ר״פ . Recalling that Hebrew Letters can sometimes act as numbers you recognize that letter chet ח̇ is functioning as the number 8 and ר״פ abbreviation on side of it is shorthand for ראש פסוק (rosh Pasuk / head of verse). You quickly conclude that the ancient masoretes are trying to tell you that:
Psalm 23:1 contains one of 8 instances where מִזְמ֥וֹר לְדָוִֽד occurs as the first two words of a verse.
Naturally, this arouses your interest, unfortunately, the Masoretic notes that lead you to the other 8 verses are not to be found in the BHS. Fortunately, however Bible software and or concordances can speedily provide you with the answer. You find that the string מִזְמ֥וֹר לְדָוִֽד occurs 28 times in the Hebrew Bible then scanning through the 28 verse you discover that Masoretes were correct in indicating that מִזְמ֥וֹר לְדָוִֽד appears as the first two words of a verse 8 times in the Binle or as a heading.
are a Mizmor of David. (by the way during the Masoretes times there were not verse number systems so the Masoretes simply wrote either the most notable words of a verse or the first few words.)
Now you turn you attention to the second the raised circle found over the רֹעִ֗י (my Shepherd) and turning back to the margin and notice ה̇this time there is a ‘hey’ rather than a ‘chet’. The ‘hey’ being the 5th letter of the Hebrew alphabet is clearly acting as the number 5. This means that רֹעִ֗י rather something about רֹעִ֗י occurs five times. It is pretty clear that word shepherd must be found more than five times in scripture so what then are the Masoretes trying to communicate. In a real codex, both the Masorah Parva (short notes) and the Masorah magna (longer note) are present but in the BHS there is only room for the short notes so the longer notes were put in another volume. At the bottom of the page, you notice the register alerting you the MM (Masorah Magna) being found in the sperate volume under the index number 3232.
So, you head over to Gérard Emmanuel Weil‘s transcription of the
Masorah Magna found in the companion volume for the BHS (either in print or in faith life Logos Bible Software’s: digital edition as pictured below) :
Directly above the verse list, you see the note רֹעִ֗י ה̇ סימנהון telling you that these are the five times.
Now, you understand that although the lemma for Shepherd appears l67 times in 138 verses “My shepherd” in this morphological form is found only five times and thus these terms and verses are special in the scriptures. Of course a word looking the same as my shepherd but meaning my friend also occurs throughout scripture. In the pre-Masoretic text without the vowel points and accents, both ‘My friend’ and ‘My Shepherd’ would have been identical. This leads you to consider the possibility that the writer of Psalms my have had both meanings in mind.
There are a lot more layers of Masoretic notes but we only briefly look at two examples of one type of the notes. Keep in mind this excessive was only at the word level. Later one might also like to look at the semantic level, sentence level, passage level, and discourse level.