There's no point leaving LaTeX to automatically generate the section numbers if you have to keep track of them all, and change all your cross-references every time you add a new section. Fortunately LaTeX provides a way to generate the correct number. All you have to do is label the part of the document you want to reference, and then refer to this label when you want to cross-reference it[ Referring to labels in other documents ]. LaTeX will then determine the correct number that needs to be inserted at that point. This label can be anything you like as long as it is unique, but it's a good idea to make it something obvious so that, firstly, you can remember the label when you want to use it, and secondly, when you read through your code at some later date, it's immediately apparent to you to which part of the document you are referring. People tend to have their own conventions for labelling.
Cross referencing sections and equations - Overleaf, Online LaTeX Editor
This section will give an overview the labeling capabilities of LaTeX. We will learn to label the float environments we have already covered. Labels are a necessary part of typesetting as they are efficient pointers to information. It is better to reference Table 2 rather than "that table where I list all of those things. One of the most useful and occasionally underrated properties of LaTeX is the ease and power of its labeling system. This allows one to reference equations, figures, tables, etc, with ease and flexibility.
One of the most useful features of LaTeX is its ability to handle cross-references. To use this, we first define a label at the section or equation, table, etc. When you run LaTeX on a document with cross-references, it often doesn't know which section the references actually refer to.