Getting your Heroku app to use your custom domain
You'll first need to buy your domain. I use Vercel — the cheaper domains cost $20 there. I'll use Vercel screenshots for these instructions.
So, after you've bought a domain, in the 'Settings' tab in Heroku, you'll find this section called 'Domains'.

Click the 'Add domain' button. You'll see this pop-up on the right-side of your screen.

Just put your domain name that you bought in there and click 'Next'. You'll then receive a 'DNS target' like the one below:

We will use this DNS target in a minute. For now, go back to Vercel (or wherever you purchased your domain). We need to configure your DNS records. The 'DNS Records' section under the 'Domains' tab in Vercel looks like this:

Full disclosure: I don't fully understand how all this DNS business works. I just know how to get the domain you purchased to point to your app on Heroku. You just need to make sure you enter the correct values for the DNS record. We will create two records. Enter these 3 values for the first record:
- For 'Name', you can put 'www' as the subdomain
- For 'Type', choose 'CNAME'
- For 'Value', paste in the DNS target that Heroku gave you

Then click the Add button. You can leave 'TTL' and 'Priority' as they are. We'll add one more DNS record for the type ALIAS. Do the following:
- Leave 'Name' blank
- For 'Type', choose 'ALIAS'
- For 'Value', again, paste in the DNS target that Heroku gave you
The table of your DNS records should look something like this:

And that's it. Allow some time for the DNS records to propogate. After about 30 minutes, you should be able to visit the custom domain you purchased and see your Heroku application.