How to free up space by storing files online only?
Navigate to your OneDrive or SharePoint folder in File Explorer.
Select the desired files and folders, then Right-click on them and select "Free up space" from the context menu.
Once the Files are store online only, File Explorer will show one of the following overlay icons for files in the cloud:
With Icon view:
With Details view:
If you later decide you want to put an online file or folder back onto your hard drive, Right-click it and select "Always keep on this device" in the context menu.