dig is great until you only want the IP address and get thirty lines of header, flags and statistics. There is a switch for that.
Add +short and dig prints only the answer data, one record per line. It is the version you can paste into a script or read at a glance.
dig +short example.com
dig +short MX example.com
dig +short TXT example.com
The record type goes before or after the name, dig does not mind. For a CNAME chain you get each hop on its own line, which is a quick way to see where a name really points.
The catch: +short throws away the TTL, the status and the server that answered. If a lookup returns nothing, you cannot tell whether the name does not exist or the record type is missing. Drop the switch and read the header for that. I keep +short for when I already trust the setup and just want the value.
If you want a specific server to answer, put @server in front of the name. That makes +short a decent tool for comparing two resolvers side by side: run the same line twice with a different server each time and see whether the values match.
Further reading: dig manual (BIND 9), On this site: dig can speak DoH and DoT itself, On this site: dig +ttlunits makes TTLs readable
Going deeper: Guide: dig for beginners, look up DNS records and read the answer