Locator are used to find and match the elements of the page you are working on for testing which needs to interact with you.
Here the element I am talking about are the different web elements that are required to search or handle the webpage to interact with you.
The above marked blocks are the different web element that locator helps to play with. The work of locator here is to find the relevant webelement according to the users request and then work with that and help the user interact with the web page.
Again there are different types of locator, you can find the details here:
Hope this helps you.