You need to host your domain somewhere, meaning some DNS provider needs to be the authority on what gets routed where when someone accesses your domain.
The provider will give you a list of nameservers when you make the domain part of their DNS.
I don't know if there are any that are free (if you don't also buy a domain from them), so you'll have to check on your own. You can also self-host a bind9 server and do your DNS there.
bunny.net is technically $1/mo but you don't pay anything in months where the queries against their servers fall under a threshold. With a low use personal domain you can basically load up $10 worth of credit and coast on it for a year or more.
Please don't self-host DNS. It can be exploited and abused in many ways if you don't know what you're doing.
Seconded
One of these is DNS reflection, a type of amplification DDoS I found out about several years ago... You send a tiny packet to a DNS server requesting a domain with long records, but tell the DNS server to send the response to another address. Pretty interesting and amusing imo, but probably not if you're on the receiving end of one lol
"If you do everything perfectly you won't have security problems."
But people make mistakes. Human error and misconfigured servers is the cause of many security flaws. Especially people asking "what should I provide for DNS on this domain registration form?"
DNS services are dirt cheap. Hosting yourself requires some knowledge to run security, and you need a static IP address to host one which many people don't have.
Do either of the options you mentioned provide custom nameservers? As in, the ability for ns01.yourdomain.com to resolve to your account on their DNS servers?