My M31 was broke because of the failed OTA update from Samsung, but after researching about if I finally restored my mobile, here are the procedure which i followed..
download Odin software.https://dl2018.sammobile.com/Odin3-v3.14.4.zip
download...
USer data is also recovered, that is why we use Home_CSC instead of CSC file.
Only your phone software will be restore, it will not touch anything else.