Clearing drive space

When trying to install or really do anything using command line I keep getting an error message reading “failed to write (no space left on device)” can anyone tell me how i can go about clearing any extemporaneous data that may be on the drive for some reason or another. Thanks!