How to remove Sharepoint files synced on Onedrive, without deleting them.
In the Sharepoint folder, you have clicked on the “Add to Onedrive” icon and now all the Sharepoint files are in your Onedrive. Yikes! Sharepoint files on Onedrive don’t show the site name. These files should be synced not added, so that these are kept in a separate subfolder, under the site name. In the picture below, OneDrive points to your organization’s OneDrive account. The next 3 top folders are synced Sharepoint folders. They can be your organization or external parties eg suppliers or customers.

Do not delete those Sharepoint files in the Onedrive as it will delete the original files. You will need to isolate these files first. To do that, in Onedrive settings, stop the folder sync. (Settings, Account, Choose folders, untick).
The Sharepoint files in Onedrivewill now disappear or showed up as local files. You can now safely delete them.
To add Sharepoint files to Onedrive, click the Sync button.