my galaxy s8 did not have enough free storage for a few months now (something about 20 mb free) and i remember over the course of these few months a notification from samsung saying something about data loss and i didnt pay attention to it. today i woke up and turned my phone on and discovered that my phone has deleted 3 giga byte of storage and i cant seem to find out what it is that got deleted and im a bit worried.
It's usually user data such as pictures, music, emails etc so it would probably be a case of checking through your phone.
I'd suggest to start using an online vault such as Google drive and or Dropbox to save your data in and go through your phone to delete unused or old data / use a sd card etc.
You can use device care to help delete old files etc and you can clear the system cache files by turning your phone Off and then from a set series of button presses go into the phone's system files and clear the system cache. None of your own data is lost this way.