When a page loads fonts or an API from another domain, the browser first has to look up the name, connect and do the TLS handshake. That costs time before the first byte arrives. You can tell the browser to start on that early.
<link rel="preconnect" href="https://example.com">
Put it in the <head>. The browser opens the connection right away, so when the real request comes, part of the work is done.
For fonts, add crossorigin:
<link rel="preconnect" href="https://fonts.example.com" crossorigin>
web.dev is clear about why it matters here: if you leave crossorigin off, the browser only performs the DNS lookup.
For less important origins, dns-prefetch is the cheaper hint: it only resolves the name. web.dev suggests it as a fallback too, but as a separate tag. Putting both in one rel attribute triggers a Safari bug that cancels the preconnect.
Caveats. Do not preconnect to everything. MDN says doing it for many third-party domains can be counterproductive, and web.dev warns about too many origins competing for bandwidth. A preconnected connection that is not used within about 10 seconds is closed again, so it only helps for things the page needs right away. I’d keep it to the one or two origins that block the first render.
Further reading: MDN: rel=preconnect, web.dev: preconnect and dns-prefetch, On this site: fetchpriority="high" loads the hero image first