A few things to try.
*very first is to go to samaung members apps- support- diagnostics. All pass okie?
Then- clear cache partition
https://www.samsung.com/uk/support/mobile-devices/how-do-i-clear-the-cache-on-my-device/*make sure device is plugged in before attempting
*if it doesnt work it may be time to backup all data backed up to PC via smart switch. Then a factory reset.
If still nothing it could be time to contact customer support for a repair
*UK weather is getting hotter which may lead to overheating. Your phone being 3 years old the battery could also develop a fault.