Meta has pushed many security-focused features and improvements to WhatsApp in recent months, including an option to hide locked chats behind a secret code.
WhatsApp also made locking chats quicker by introducing a dedicated shortcut in the chat list and another in the chat info screen in the Android version of the app, and those shortcuts are now making their way to the iOS version.
The latest TestFlight (beta) version (23.24.10.78) of WhatsApp for iOS has a toggle for locking chats from within the chat list by accessing chat options for a particular contact/conversation.
Like the Android version, one can also access the chat locking toggle from the chat info screen. Both shortcuts do the same thing, and users can use either of them to quickly lock or unlock chats that they wish to hide.
As always, WhatsApp isn't rolling out the latest features/changes to every beta user at the same time, and it could be a few weeks before they are widely available to all beta users and a few more weeks after that to make it to users of the standard non-beta WhatsApp app.