1. Create a plain text file
Name it robots.txt and place it at the root of your domain.
2. Add the rules
Use User-agent to choose the crawler and Disallow to block a path, such as an admin area.
3. Link the sitemap
Add a Sitemap line that points to the full address of your sitemap.
4. Test it
Use a robots testing tool or your search console to confirm the rules work as intended.