Salah ( the prescribed 5 daily prayers) engages the prefrontal cortex that is the seat of the executive functions ; the ones necessary for rational thinking, planning, inhibition, etc. Executive function is also called cognitive control and basically puts you at the helm of your own mind and prevents the reptilian brain that is focused on pleasures and very basic instincts from taking over. It strengthens the part that is capable of resisting procrastination, delaying immediate gratification, prioritizing, etc.
Salah essentially reboots and recalibrates the information processing center. By sticking to a continuous schedule that isn’t broken by anything, it forces you to remain proactive and engaged in life. It upkeeps a baseline in your life that is essential for your mental and emotional stability. Instead of being driven by ego, you’re guided by your higher self that is allowed space when the base desires aren’t running things.
إِنَّ الصَّلَاةَ تَنْهَىٰ عَنِ الْفَحْشَاءِ وَالْمُنكَرِ ۗ وَلَذِكْرُ اللَّهِ أَكْبَرُ ۗ وَاللَّهُ يَعْلَمُ مَا تَصْنَعُونَ
Indeed, prayer prohibits immorality and wrongdoing, and the remembrance of Allah is greater. And Allah knows that which you do.