To enable Lightning Web Security in Salesforce follow these steps:

  1. Go to the Setup page.
  2. Navigate to "Session Settings". You can find it under the "Security" section.
  3. In the "Lightning Web Security" section, check the box next to "Use Lightning Web Security for Lightning web components (GA) and Aura components (Beta)"
  4. Click on the "Save" button to save the changes.
  5. By following these steps, you will enable Lightning Web Security for both Lightning web components and Aura components in your Salesforce org