The quick way to give a service its database password is Environment=DB_PASS=.... The systemd.exec manual is blunt about that: environment variables are not suitable for secrets. They are exposed to unprivileged clients over D-Bus and get inherited by child processes. LoadCredential= is the way systemd wants you to do it.
You give the credential a name and a source file. When the service starts, systemd copies the data into a read-only location that only the service’s user (and root) can read, often backed by memory, and exports that folder as $CREDENTIALS_DIRECTORY:
sudo systemctl edit myapp.service
[Service]
LoadCredential=dbpass:/etc/myapp/db-password
ExecStart=/usr/local/bin/myapp --password-file=%d/dbpass
The %d specifier expands to the credentials directory, so the app reads its password from %d/dbpass. The source file can stay root-only with mode 600: the service manager reads it, the service only gets its private copy. That fits nicely with DynamicUser=yes, where the service user doesn’t even exist until it starts. If you leave out the path (LoadCredential=dbpass), systemd looks in /etc/credstore/, /run/credstore/ and /usr/lib/credstore/ for a file with that name.
A quick way to see it work is a small test service that prints $CREDENTIALS_DIRECTORY and lists the folder; the file shows up there under the name you chose.
The caveat: your app has to be able to read a secret from a file. Many can (look for --password-file or a _FILE variable), but one that only takes an environment variable needs a small wrapper script that reads the file and starts it, and then the secret is back in the environment of that one process. Also, a missing source file at an absolute path stops the service from starting, which I’d count as a feature. For extra protection there is LoadCredentialEncrypted=, which decrypts a credential made with systemd-creds encrypt only at start.
Further reading: systemd.exec(5) manual page