I have alternated my approach to Religion and the Gods.
Some campaigns have had full custom Creation Myths, establishing custom pantheons; about half those games have the gods directly meddling, while the other half is "... and that's why they died/left/pulled-back."
More campaigns have used the (insert current edition) D&D pantheon, with the (standard at the time) lore that the gods have to answer prayers and help worshippers, or they lose their power -- but they have their favorites (i.e. PC religious classes, plus certain priests / towns / locations). Generally, "religion" in these campaigns comes in two forms: some people dedicate themselves to a certain god, while most people give prayers and offerings to whatever god's portfolio matters at that moment. So one farmer might be a Pelor devotee, while his neighbors sometimes pray to Pelor for good weather and harvests, but also Meilikki for their livestock (foaling, health), or even Erastus when they have to go to town (hoping the guard protect them from scoundrels). [Apologies if I got the diety names wrong.]
One campaign had a NPC who had raised himself up to demigod status make a deal with one of the PCs for worship, providing that PC certain bonus powers, in order to jumpstart the NPC's rise to true godhood.
Another campaign had the players -unwillingly!- becoming avatars of the gods in a direct struggle for the gods' survival against one of their own. (This resulted in each PC getting one or two iconic powers of their Patron - but so did the enemy "heroes".) Most of the PCs were willing soldiers, once they found out, but one PC played into the "I didn't ask for this!" storyline.
The current campaign has a period of history where "the gods went silent", but then slowly started to answer prayers again - weakly, and only when large numbers focused on the same desired result. Over time - before the campaign, still - power increased; at the time of campaign, a major city's congregation, led by a skillful priest, can accomplish Level 3 "miracles", while any good-sized village can occasionally manage a Level 1 "miracle". (Interestingly, the fanatic beliefs of cults enables even a small gathering of "non-spellcaster" cultists to pull off Level 1 or even the occasional Level 2 spell!) Due to the need for many believers focused on a single result in order to achieve "miracles", the rulers and priests of the land moved to have the pantheon worshipped as a whole. So while Pelor, Meilikki, Erastus, Moradin, Corellon, and all the others are named and have representation, the opportunistic farmer from earlier in my post would instead worship the Pantheon, at The Temple, and if everyone was praying for that good weather, then it might happen. (His neighbor, the Pelor fanatic, might gather secretly with his totally-loving-and-not-creepy-or-cultlike-at-all "extended family" at high noon in the mirrored solarium, and achieve miracles of healing and maybe the occasional searing light directed at a rival's crops...)
In this campaign, though, for Story reasons that have not been investigated by the PCs, the gods have favorites: Clerics and Paladins. These folk can achieve, on their own, what it might take dozens or even hundreds of parishioners to accomplish - and in moments, not after hours of praying! These PCs (and the rare NPC) have a tremendous standing in society - and are subject to incredible political pressures.
[As a reference point, the average joe in the world is roughly 2nd or 3rd level, elites are 3rd and 4th (with extra feats or training), and the pinnacle celebrities are 5th level. All spellcasting classes are subject to varying levels of political and social control, for Story reasons. And PCs were capped at 5th until certain conditions were met; they are currently capped at 8th, until other conditions are met - but they are accumulating additional feats and powers in lieu of level-up.]
So the average person believes in the Gods, as a whole, and goes to Temple in order to help the congregation achieve miracles. And the Gods answer the "loudest" and "most fervent" prayers - plus their favorites! Meanwhile, the PC dwarven war cleric worships Moradin specifically, and selects his spells along the themes of just Moradin's portfolio... but also metagames his "faith" when he really wants a different spell, like water breathing!