It is possible to have 3 states when it comes to OneDrive files.
- Always available
- Locally available
- Online-only
See this link for full details: Set Files On-Demand states in Windows - SharePoint in Microsoft 365 | Microsoft Learn
I'm backing up some files that would fill up the C drive so each time I backup a file I unpin it. My OneDrive can hold 5TB so now I can keep lots more data when unpinned.
This is an example of how to unpin locally and save space. This is excellent in batch files for multiple files/folders.
attrib +u "C:\Users\[username]\OneDrive - [Company Name]\[FolderName]\*.*"
This can also be accomplished by using the right click menu in Windows Explorer.