The Huawei device can go to sleep automatically if the device is not in use. You can set the sleep timer from 15 seconds of non-usage to 10 minutes maximum.

Note: If a security or fingerprint is active on your device as a unlock method, you will need it to unlock.

Android 10 | EMUI 10.0
Sleep -  Open the  settings
Sleep -  Tap on  Display & brightness
Sleep -  Tap on  Sleep
Sleep -  Choose a  time  for sleep mode
  1. Open the settings
  2. Tap on Display & brightness
  3. Tap on Sleep
  4. Choose a time for sleep mode

Huawei Instructions