If your PC must be exposed to the public, you need to optimize its security. Under standard configuration, Windows asks for a user profile and password, but when it comes to locking your PC so that no one has access, there are other options you might want to consider more closely, including patterns like the ones we use on mobile devices, and invisible passwords, without dialog boxes or confirmations.
Windows security needs a lot of help, no doubt about it. In fact, it is not far-fetched to think that a computer is automatically compromised if an external element gets physical access. The ideal would be to prevent that possibility from the start, not only to take care of the hardware, but also to protect your personal information, which at the end of the day is the most valuable thing.
However... there are times when we have no alternative. A shared PC, a point of sale, a system that serves as a demo, the list goes on. To improve security in general terms you can always use something like Hardentools, but if your main goal is to lock your PC so that no one has access, you should consider one of these three solutions.
How to lock your PC: Windows lock screen
The most obvious thing first: good discipline around the Windows lock screen will help you avoid many problems. For it to work, the active profile must have a password, and from there it is all a matter of pressing the Win+L combination, or using Ctrl+Alt+Del and selecting the Lock option.
Another good habit is to set a PIN as an alternative to the password (the PIN can be alphanumeric) and cauterize the security questions, in case someone has too much luck guessing the answers. Needless to say, a prepared user will easily escape the Windows lock screen... but that is another story.
Eusing Maze Lock
Unlike the traditional Windows solution, Eusing Maze Lock offers the option to lock your PC using a pattern similar to the one we see on tablets and smartphones. You can modify the pattern size (3x3, 4x4 or 5x5), customize a message at the bottom, and configure secondary parameters such as cutting off the Internet when the computer is locked, or turning it off if someone fails the pattern three times.
Now, Eusing Maze Lock is not perfect: it has some issues on Windows 11, it doesn't get along with start menu replacements, and finally, it has a fairly aggressive nagware profile. The program is free and without restrictions, but it will ask you to register with great insistence.
ScreenBlur
The last update of ScreenBlur dates back to 2016, but I must admit it still works quite well. One of the most interesting aspects of this program is the ghost password, that is, you don't have to enter it in a classic box, but rather you type it on the fly, directly. The program optimizes its security by stealing focus (so that it is always in the foreground) and simulating clicks so that there are no unexpected changes.
ScreenBlur can start with Windows, but you will need to set a keyboard shortcut and start it manually to lock your PC. It also allows you to customize the lock screen with different images, and includes several factory options. The program must be installed manually in a folder, since it does not have a formal installer.