Portainer pulls anonymously from Docker Hub by default. That works until you need a private image or pull a lot of them.
In the menu go to Registries, click Add registry and choose DockerHub. Fill in a name and your Docker Hub username. For the secret, use an access token. You create one in Docker Hub under your username menu, Account Settings, on the Security tab. Click Test connection, and when it passes, Add registry.
Test connection has to succeed before the registry can be added, which saves you from a typo that fails later in the middle of a deploy.
An access token is my pick over the account password for a plain reason: you can revoke it without touching the account. The docs name a token, though they do not say why.
Caveat: the docs say Docker Hub is not currently supported as a source for OCI-format Helm charts, so this is about container images.
After that the registry appears in the list when you pick where an image comes from, so a private image becomes a dropdown choice instead of a command you have to remember. You can add other registries the same way, with guides for GitHub, GitLab, Quay and a custom option for the rest.
Further reading: Add a Docker Hub registry, On this site: reset a forgotten Portainer admin password with the helper-reset-password image, On this site: start Portainer with –admin-password-file instead of typing the password in time