Windows 10 Storage Sense works with OneDrive to automatically free up space by making locally available OneDrive files that you aren't using anymore online-only again.
Important: Storage Sense is a silent assistant that works on your behalf with very little setup. Storage Sense is available for Windows 10 version 1809 and later.
Any files you haven't used in the last 30 days can be set to online-only when your device runs low on free space. You will also be able to schedule how often Storage Sense runs.