Hello ,
I’m here to help you in resolving your issue
Yes! You can make your computer automatically lock when you close the lid by adjusting your power settings.
Change Power Settings
1: Press Win + R, type control panel, and hit Enter.
2: Go to Hardware and Sound > Power Options.
3: Click Choose what closing the lid does on the left panel.
4: Under When I close the lid, set it to Sleep or Hibernate instead of "Do nothing."
5: Click Save changes.
Since Windows locks automatically when sleeping or hibernating, this will ensure it locks when you close the lid.
After trying above steps, please reach out to me if you have any doubts or issues
Help others by sharing your experience! Click “Yes” if this solution worked for you or “No” if it didn’t.