Linux Hint published a tutorial about how to free up disk space on Raspberry Pi.
How to Free Up Disk Space on Raspberry Pi
There are several commands to free up disk space on Raspberry Pi, to automatically clean up the system space use autoremove or autoclean command.
How to Free Up Disk Space on Raspberry Pi