There are supposedly two ways that this could be done, but only one has worked for me, so that is the one that I'll be showing here.
This is done by using browser cookies. Here's how to do it:
yt-dlp --cookies-from-browser [browser name] [youtube link]
Replace "[browser name]" with the name of your browser, the ones that are supported are, brave, chrome, chromium, edge, firefox, opera, safari, vivaldi.
And obviously replace the "[youtube link]" with the link of the video that you want to download.
You can also add this to your config file so that you don't have to type this in every time. In your config file, add a new line.
--cookies-from-browser edge
Replace edge with the browser of your choice, and you should be golden.