You’ll need to choose a hosting provider / server first before you could obtain (and more importantly, use) a certificate for your website. (Because your website need a IP to host on…)
If you purchased a plan through hosting provider, most providers would provide you instructions on how to setup (point) your domain to their server… (Shared hosting)
(A medium percent of those providers have automatic certificate, which means you mostly don’t need to worry about requesting the certificate and renew it)
You could obtain a certificate via DNS validation (like any other commerical certificate provider, obtain the certificate by adding a required DNS record)... But I can't imagine any use for a domain certificate without a hosting...
It might be technically possible, but it is difficult and inconvenient. Normally, you should have a hosting plan first.
@stevenzhu mentioned that some web hosts support Let's Encrypt automatically (so you don't have to obtain the certificate yourself, because the web host can do it for you). There's a big thread on this forum to try to make a list of the web hosting providers who make this convenient:
It's fine to obtain the certificate before the hosting...
However, since obtaining the certificate is relatively easy and takes a short time, you could also do it after you got the hosting.
Try sslforfree.com or zerossl.com (select txt validation and follow their instructions please)
(web based client because GoDaddy does not seems to have effective API)
The particular command you ran yesterday was meant to be run on your web server, which effectively doesn’t exist because you don’t have web hosting yet. It wasn’t meant to be run on your own computer.
If you have caddy server, you should already have a IP (or you'll need to publicilize your server onto www... For information on this, please Google it since cases varies)
You just need to point the server to the IP and test if the website is working in http. If it's working (and pointed correctly), run the caddy program that specifically designed to obtain let's encrypt certificate.