Getting a certificate is one job and editing the nginx config to use it is another. Certbot can do both.
With the nginx plugin installed, run:
sudo certbot --nginx -d example.com -d www.example.com
Certbot finds the matching server block, proves you control the domain through a temporary challenge, stores the certificate under /etc/letsencrypt/live/, and adds the ssl_certificate lines to your config. It also redirects HTTP to HTTPS by default and reloads nginx. Add --no-redirect if you don’t want the redirect.
Check that renewal works before you rely on it: sudo certbot renew --dry-run. Most packages install a timer that renews certificates in the background.
A caveat: certbot edits your config files. Look at the result with sudo nginx -t and read the changes, especially if you manage the config by hand or with templates. If you’d rather keep control, use certbot certonly --nginx and write the SSL lines yourself.
Further reading: Certbot instructions
Going deeper: Run degoog on Unraid as your own search page, compared with SearXNG and 4get