M365 Storage (How To) Stop Sharing a File or Folder from SharePoint or OneDrive
You can stop sharing an item, or change the permissions others have to it, if you're the owner of the item or have edit permissions.
Stop sharing OneDrive or SharePoint files or folders, or change permissions - This Microsoft article provides instructions on how to stop sharing files and folders in OneDrive and SharePoint.