What the meta robots tag is
The meta robots tag is placed in a page's <head> as <meta name="robots" content="...">. It gives page-level instructions to every search engine. Replace robots with a crawler name, such as googlebot, to target one engine only.
With no tag, the default is index, follow, so you only need the tag when you want to change that behaviour.
The directives
noindex keeps the page out of results. nofollow asks crawlers not to follow the links on the page. none equals noindex, nofollow. nosnippet hides the text snippet, max-snippet:[n] limits it to n characters, max-image-preview:large allows large image previews and max-video-preview:[n] limits video previews. noimageindex stops images on the page being indexed, and unavailable_after:[date] removes the page after a date.
Directives can be combined with commas, for example noindex, nofollow. If directives conflict, Google applies the most restrictive one.
Meta robots versus robots.txt and headers
Robots.txt controls crawling for whole paths; the meta robots tag controls indexing for a single page, and the crawler must be allowed to fetch the page to read it. For non-HTML files such as PDFs, send the same directives in an X-Robots-Tag header.
Example
Meta robots examples:
<!-- Keep out of results, still follow links -->
<meta name="robots" content="noindex, follow">
<!-- Allow large image previews and full snippets -->
<meta name="robots" content="max-image-preview:large, max-snippet:-1">
<!-- Google only -->
<meta name="googlebot" content="nosnippet">