Need help reinstalling macosx

I ran into a problem with my 2017 iMac where it freezes halfway through the restart screen. I tried to do the first aid in recovery mode but nothing worked

I’m now trying to reinstall macos without deleting all my data but I don’t have enough storage to do that.

Is there a way to delete some storage without being able to boot up my mac?