These are the causes of your problems and their solutions
1) User mistakes - you did something on the phone that caused the phone to behave this way .
solution: Undo what you did if you remember it otherwise do a factory reset . If that fails install a new ROM through sp flashtool .
2) Faulty application - an application you downloaded is causing this problem
Solution: uninstall that application if you know it otherwise do a factory reset if you don't. If that fails install a new ROM or reinstall the old one through sp flashtool .
3) Your ROM is fauly - this is because your new ROM is buggy or you played aroung with flashing zips (e.g twrp or other zips through twrp) and played around with root and the permissions you gave to certain applications that messed around with the system.
Solution : Flash a new ROM or reflash the old ROM of you think the zips caused the problem and not the ROM itself ..
4) Hardware problem : sometimes you might be the unlucky one who gets the faulty hardware on your phone , or maybe you just dropped it and caused the problem .
Solution: Return the phone to the manufacturer if its still under warrentry , otherwise get to a repair shop