Whenever the screen of your device turns off, it locks. The ON/OFF button on your device lets you turn off your screen but also switch it back on, giving you access to the unlock screen.
By default, no specific security is imposed, you simply need to slide the lock to the right, as shown below.
You can modify this security at any time by adding a lock screen with a pattern, PIN code or password.
To activate this security, go in (or) Settings > Security > Screen lock. You will also have the possibility to either remove the need to unlock or unlock your screen via Face Unlock, a facial recognition tool.
If you loose your PIN code or password, you don't have any other choice than to restore your device to factory settings loosing all your data in the process. If you don't remember your pattern, you can connect to your Google™ account after several failed attempts.