How to set password request for booting the smartphone? How can I set the phone so it requests to unlock the screen before starting up?

Earlier I had to unlock the phone so it starts up but now it boots without unlocking (and I didn't change anything in this regard, at least deliberately). (I bought it as used so I don't know how it was activated).
It seems that there was an issue described in the link provided by Firelord in the comment:

Don't get tempted by any app asking you to enable its Accessibility Service. It will change your encryption password to the Android default one allowing everyone to decrypt the &quot;encrypted&quot; data. The PIN you enter at powering on your device may not be used for encryption at all - without a warning given.
If you use encryption on your Android device, follow these steps now:

Open up the Accessibility settings menu.
If a Accessibility Service is listed there at the top, disable it.
Change your screen lock PIN/password/pattern whatever to reset the encryption password. Make sure to tick the &quot;Require PIN to start device&quot; option.


These three steps reactivate the password request for powering up on Android 8.0.