A note with Wi-Fi codes or account details should not be readable by anyone who borrows my unlocked phone. The Notes app can lock a note, and the setup has one decision and one sharp edge.
First choose how locked notes open. Go to Settings, Apps, Notes, Password. You can pick Use Device Passcode or Create Password, and with a custom password you also set a hint. Face ID or Touch ID can be switched on as well. The device passcode route needs iCloud Keychain to be on.
Then lock a note: open it, tap the More button, tap Lock. The note shows a lock icon, and you can hide its contents by tapping that icon. To read it again, tap the note, then View Note, and authenticate. Apple says locked notes stay open for several minutes, and they lock again when you close Notes or the device goes to sleep.
The sharp edge is recovery. Apple states that it does not have access to locked notes and cannot help you if you forget your notes password. Resetting the password (Settings, Apps, Notes, Password, Reset Password) only sets a new password for notes you lock from then on. Notes that were locked with the old one stay out of reach. That is why I would take the device passcode option, or write the custom password down somewhere safe.
Some things cannot be locked at all. Apple lists notes with tags, PDFs, audio, video and Keynote, Pages or Numbers documents, plus shared notes and notes synced over IMAP such as Gmail or Yahoo. A Managed Apple Account cannot lock notes either. If a note you want to protect is shared, stop sharing first.
One more consequence: removing a lock applies on every device signed in with the same Apple Account, so unlocking a note on the iPhone unlocks it on the Mac too. Apple’s page does not mention a way to relock a note instantly, so if you want it hidden right now, close the app or lock the phone.
Further reading: Apple Support: How to lock or unlock notes on your iPhone or iPad
Going deeper: Guide: Immich on Unraid, back up the photos on your iPhone automatically