There are two major ways to create a god NPC. The method depends on the purpose the character serves in the campaign. In either case, the god should help facilitate an adventure for the PCs. It is seldom a good idea to create a powerful NPC with a strong presence that fails to further the story.
The Golarion Pathifinder setting provides excellent examples of both methods with true gods and demigods, as described below.
1. Plot Device
I sometimes call this a "force of nature" NPC. A plot device god works best as some nebulous force that drives the plot by helping the PCs or complicating their lives. They rarely should directly interact with the PCs. The goal of any encounter with the plot device god should involve a quest, social encounter, or any other encounter that does not involve physical confrontation. A friendly plot device god might be a quest giver while an enemy plot device god might create a storm or a curse that can only be appeased with a quest.
Roleplaying Interactions
If the god must expose themselves to direct confrontation, then make sure all interactions are fun and interesting to the players. If a PC attacks then, don't just say "it doesn't work." Have something interesting happen, like the weapon going through them or blowing the fighter away. If you don't want this to happen at all, then have the god manifest in a way that makes it impossible for both sides to directly affect each other. Maybe the god appears as a reflection in the mirror or as a ghostly avatar.
Estatísticas
A god as a plot device should not have any actual statistics. Creating a stat block is unnecessary, patronizing to the players, and limits your ability as a GM what they can and cannot do. By creating a stat block, you create limitations of the character's power, which is not something you want to do when creating a character as an unassailable force of nature.
Exemplo
True gods in the Golarion are excellent examples of plot device gods. They have no statistics and rarely directly interact with PCs. True gods affect a plot by changing the circumstances or direction of an adventure. For example, in the module Clash of the Kingslayers, a god transforms a temple into a massive walking monster that the party has to go inside and explore in order to figure out a way to stop it. In the Ira dos Justos adventure path, a goddess offers mythic power in exchange for passing a test.
2. Active Character
A god as an active character essentially functions as a very powerful NPC. As such, you would stat and run them as you would any sufficiently powerful NPC. Such a god directly affects the PCs with their actions. However, it's absolutely vital that the PCs can interfere with or invoke those actions. Do not have an evil god enact an evil plan unless the PCs have some way to thwart it. Do not allow a good god fix a problem unless the PCs actively do something to receive that aid.
Roleplaying Interactions
You need to determine a good reason why an active god won't wipe out a party or make an adventure trivial. An enemy god might not be able to do so or find it impractical to directly confront the PCs. Maybe they don't see the PCs as big of a threat to directly deal with? A good god might be too occupied to directly do the PCs's work for them.
Usually the best way to handle it is having the PCs only interact with NPCs that work for the god. Maybe they have to face the evil god's minions. Maybe they can only speak to a good god by their servants. For a low level campaign, an active god should work more like a plot device god.
Only have an active god directly confront the PCs if you intend to change the direction of the plot (like a plot device god) or allow the PCs to directly affect the god.
Estatísticas
Follow the monster creation guidelines in the Monster Manual as you would stat any other creature. Don't just make up a list of absurd stats. Instead, determine what CR the god should be based on how high of a hypothetical party should be able do and then stat them accordingly.
Exemplos
Demigods in the Golarion setting are good active god examples. Unlike true gods, demigods in Golarion usually have statistics as a CR 20-30 creature. They're designed as powerful final opponents for a high level party or as rare allies called upon sparingly.
The Treerazer and Arazni are good examples of enemy active gods. The Treerazer is a demon trapped in a blighted forest that slowly tries to expand his influence. Arazni is a queen of an undead nation. Both of these demigods can directly affect the party without actually confronting them. A campaign using these gods will likely see the PCs thwarting their evil plans from a distance and taking down their minions until the campaign reaches a climax that confronts the demigods themselves.
Talmandor is a good example of an allied demigod as he's a force of good that likes to take an active role in a nation's politics and crusades. However, he rarely directly interferes with mortal affairs unless directly asked or if a massive national threat occurs.