Introduction

If your Custom Script is Off, then you will lose some features which you generally use in SharePoint, i.e:
An admin can enable Custom Script on Tenant Level & Site Level.
To enable Custom Script on Tenant level follow these steps:
  1. From your SharePoint site, click on the waffle icon
  2. Click on Admin
  3. Expand Admin centers and click on SharePoint
  4. On the SharePoint Admin Center click on Settings
  5. Scroll down and locate the Custom Script
  6. Click on Allow users to run custom script on personal sites
  7. Click on Allow users to run custom script on self-service created sites
  8. Click OK
Note
Changes to the tenant settings can take up to 24 hours to be applied.
To enable Custom Script on Site level follow these steps
To enable custom scripts on modern sites, you will need to use SharePoint Online Cmdlets,
  1. Open the PowerShell console
  2. Execute the command

    Connect-SPOService -Url https://tenant-admin.sharepoint.com

  3. Execute the command below with the URL for the modern site collection:

    Set-SPOSite -Identity https://tenant.sharepoint.com/sites/contoso -DenyAddAndCustomizePages 0