Most religions in fantasy are very badly written. This is because most fantasy religions don't really exist. A conglomeration of Bad Guys Out To Do Bad Things is not a religion. The Good Guys who are everything Nice and Wholesome and Twenty-first Century are not much better. And a power source for the magician you call a cleric is not a god.
Some world-building advice says to start with the creation of the world. I advise against it. Even if you are developing the world first in hope of triggering story ideas, I advise against it. For one thing, that means that your world is going to have a creation myth, and you've already boxed yourself in with that decision. Many religions don't, and haven't. Even in those with creation myths, the religion may not give much prominence to it.
In fact, myths are a dangerous source of information. Even accurate, unhomogenized, and from the source myths. I've read fantasies that clearly got their religion from neatened, homogenized, put-into-order myth books (and quite possibly written for children). Cicero's On the Nature of the Gods gives a pagan's eyes view of their disorder, with mild comments about how many Jupiters there have to be, to match all the myths of his birth. And their character can differ wildly. Compare any of the mythological tales you can run across about Ares, to this picture, drawn by the Homeric Hymns: "Restrain also the keen fury of my heart which provokes me to tread the ways of blood-curdling strife. Rather, O blessed one, give you me boldness to abide within the harmless laws of peace, avoiding strife and hatred and the violent fiends of death." And, indeed, many religions were not big on myths. The Romans imported all the Greek myths because they had virtually none of their own. The Egyptians had gods of locations; only when they unified into one country did the gods of the triumphant cities take on mythological, sphere-of-influence roles, and these tended to shift as the fortunes of cities rose and fell.
Better than myths are primary sources about the actual religious practices. What rituals are actually performed. What festivals are celebrated. What acts are required, or forbidden. Reading a lot of these, even of cultures you have no desire to
Looking at these, you will soon find that there are two types: religions that are fully built into their societies and have no rivals, and religions that grow in contrast to other religious beliefs. Hinduism, Shinto, and Greek/Roman paganism are instances of the former; Christianity and Buddhism of the later. The first class don't have names
until an instance of the second class comes along, if then; Hinduism and Shinto were named in contrast to Buddhism, and since "pagan" means a person neither a Christian nor a Jew nor a Muslim, Greek/Roman paganism hasn't really been named YET.
The first class tends to be highly syncretistic, which is to say that it can pull in all sorts of gods and practices from other regions and even other religions. Frequently this is done by identifying gods with other nation's vaguely similar gods: in the Roman times, the god Mercury was identified with the Greek god Hermes, with the Egyptian god Thoth, and -- get this -- with the German god Odin. This sometimes happened with the second class; in Japan, a oracle of the sun goddess Amaterasu (Shinto) identified Buddhist priests as the correct people to perform funeral rites. People who practice this type of religion in the absence of a contrasting religion of the second type aren't aware of their practices as religious.Obviously, since the second class comes in to being by contrasting with the first class, it defines its doctrines more strongly and obviously excludes a great deal more, since exclusion is a necessary part of definition.
Which class you pick will have a lot of effect on your society.
The religion's practices may not conform to the actual practices of its worshipers, or even the code they really lived by. It doesn't mean they don't really believe; it means they are lax. In Malory's Le Morte D'Arthur, you have chapters of noble knights -- and then, suddenly, the Grail shows up and all these noble knights are ignoble, being proud, violent, and unchaste. Samurai in Japan defy both Shinto, which holds that death and blood are defiling, and Buddhism, which denounces violence; the conflicts have featured in many a story about samurai.
And at some point, the religion shades off into magic. It may be disapproved of, it may be approved of, but people will use religious artifacts, prayers, invocations of the gods, to secure the birth of a child, to make it rain, to punish a thief, to sell a house.
Behind these lie the theology of the characters. It need not be formalized and developed, but it will exist, and in some detail; it will not be summed up as "the gods hate [selected innocent groups]". I have read a fantasy novel in which three religions are depicted. One worships the sun; one worships the moon; one worships some stars. The first two oppress the third. These are not religions. What does the sun do? What are the powers? What do the sun-worshipers regard the moon and those stars as?
religion, you would worship any appropriate god. The king would of course worship the god of kingship, but because he would want heirs, the goddess of fertility as well, and because he would want his country's merchants
to do well for tax purposes, the god of oceans, etc. etc. Priests and priestess may be in charge of propitiating all the appropriate gods. Even single-purpose priests would act as worshipers of other gods as appropriate; the idea that a priest of the marriage god should not participate in a harvest festival would be regarded as very dangerous, it might offend the god of the harvest.
Euripides's Hippolytys depicts how the actual polytheists view a man who worshiped only one god, the goddess Artemis in this case: a dangerous lunatic who will bring down the wrath of the other gods. Hippolytys's exclusive worship of Artemis is his tragic flaw.On the other hand, a god probably does not fit a neat, schematic diagram of spheres of influence. Poseidon was the god of both the sea and horses. Apollo is the god of archery, logic, poetry, and prophecy. So one god can, indeed cover a lot of bases.
Be wary about bringing the gods out on center stage. Now, if you can do it, it's grand -- I think Gene Wolfe managed
to pull it off in Soldier of the Mists. But if you can't, it's very bad indeed. And since a god should be a dreadful, awe-inspiring, numinous being, it is very difficult to be convincing with one.
Finally, under no circumstances whatsoever may you call a priest of any stripe -- a cleric.