OneNote allows password-protect of sections of a notebook, however, passwords once set are not recoverable so if forgotten there’s no way to reset access and all notes in that section will be lost. (Consider using a password manager). In addition, locked sections can still be permanently deleted without entering the password.
If you want to secure access to OneNote, a better way is to enable multifactor authentication on the Microsoft account you used to sign in. Microsoft offers several methods for protecting your account, including via its excellent authentication app.