(Thus we have made you [true believers], a just [and the best] nation) (Qur’an 2: 143)
Happiness is found between two extremes: excess and negligence. The middle course is the divinely prescribed way that saves us from the clear falsehood of two extremes --- for instance, the extremes of Judaism and Christianity. Jews had with them knowledge, but they discarded action; Christians worshipped excessively, but they abandoned the divine knowledge that was revealed to them. Islam came with both knowledge and action; it cared for the body and for the soul; and it recognized both revelation and the mind, with each given its rightful place.
When you are moderate in worship, you are following the middle path. What this means is that you should not be so excessive in performing acts of voluntary worship that you hurt and weaken your body. Nor should you abandon voluntary deeds of worship altogether. In spending, you should not be extravagant; squandering away your resources, but neither should you be miserly. Moderation in character means finding a level between being harsh and overly lenient, between constantly frowning and constantly laughing, and between lonely isolation and excessive socializing.
Islam provides a middle and just way in all affairs.
(Then Allah by His Leave guided those who believed to the truth of that wherein they differed. And Allah guides whom He wills to a Straight Path.) (Quran 2: 213)