How to set the username and password for smtpd in Postfix?

You are mixing up smtpd_sasl and smtp_sasl, the first is for users authenticating on your server to submit emails for delivery, the latter is used when postfix does not deliver directly but also through a relay and postfix itself authenticates.

Unfortunately, when connecting to my server with the username and password, I keep getting authentication failures.

You say, that you are connecting to the server, so I guess you want to use SASL for smtpd. SASL in postfix for user authentication is usually accomplished by using dovecot or cyrus.

Two hints on where to start to face the task you are actually approaching:

  • Postfix docs: SASL_README
  • dovecot docs: Postfix and Dovecot SASL