In more detail
A lookup passes through a recursive resolver, the root servers, the TLD servers and finally the domain's authoritative servers, and answers are cached for their TTL. The main record types are A (IPv4 address), AAAA (IPv6 address), CNAME (alias to another name), MX (mail servers), TXT (free text, used for verification) and NS (the domain's name servers). DNS also stores the records that route email (MX records) and authenticate it (SPF, DKIM, DMARC). Queries normally use UDP port 53, falling back to TCP for large answers; DNS over HTTPS and over TLS encrypt them.
Why it matters
Many "the site is down" problems are really DNS problems: a wrong record, an expired domain, or resolvers still serving the old answer for its TTL after a change. Lowering the TTL a day before a migration makes the switch take effect quickly. See How DNS Works.
Example
Records in a zone file for example.com:
example.com. 3600 IN A 192.0.2.10
example.com. 3600 IN AAAA 2001:db8::10
www.example.com. 3600 IN CNAME example.com.
example.com. 3600 IN MX 10 mail.example.com.