I don't think there's any way to register for more than 10 years(?)
You still need to rely that the registrar and registry keeps operating for 10 years. For .com and common TLDs you can reasonably rely that it will keep operating forever barring some sort of general collapse of society/the internet. These newer TLDs? Maybe a bit less. Registrars like GoDaddy or Namecheap or whoever may go out of business, too.
Some registrars offer more than 10 years, but the registries don't actually allow that (afaik), so you're really just depositing money with the registrar and hoping they make it work.
I've got a (static) site that I want to live for a long time, the hosting provider does allow for deposits from others, so I'm hoping to make a large deposit with the hosting provider, but also include the necessary info to allow others to pay the bills if the deposit runs out eventually. Hopefully the company stays around.
Worst case, someone can bring it back from the internet archive and give it a new home, as I did.
You still need to rely that the registrar and registry keeps operating for 10 years. For .com and common TLDs you can reasonably rely that it will keep operating forever barring some sort of general collapse of society/the internet. These newer TLDs? Maybe a bit less. Registrars like GoDaddy or Namecheap or whoever may go out of business, too.