Choosing the right type.
TO POINT A NAME AT A SERVER
An A record, with the server's address.
TO POINT A NAME AT ANOTHER NAME
A CNAME. Not at the bare domain unless your provider supports flattening.
TO DIRECT MAIL
MX records, pointing at a hostname that itself has an A record.
TO VERIFY DOMAIN OWNERSHIP
Usually a TXT record. Sometimes a CNAME.
Whatever the service specifies.
TO AUTHENTICATE OUTGOING MAIL
TXT records: one SPF, one DKIM per selector, optionally DMARC.
TO POINT A SUBDOMAIN AT A DIFFERENT PROVIDER'S NAMESERVERS
NS records for that subdomain.
TO SPECIFY A SERVICE AND PORT
An SRV record, when a service asks for one.
TO RESTRICT CERTIFICATE ISSUANCE
A CAA record. Rarely needed.
TO CATCH ALL UNSPECIFIED SUBDOMAINS
A wildcard A record. Use with caution.
THE PRACTICAL ANSWER
Nine times in ten it is an A record, an MX record, or a TXT record.
If a service asks for something specific, follow their instructions exactly.