Youform doesn't support the password protection feature yet, but this is in the pipeline and will be shipped soon. You can upvote it here.
For now, the easiest way is to go to your Youform dashboard, click on the New Form button, and search for the template Password Protected Form to use that template. If you have an existing form, you can just check how that password-protected form is created using the logic builder by going to the logic builder of that form. It will be very easy to implement.