In my world, religion isn't simply true — it's manifestly true.
Generally, prayers are "correct" if they ask for a clearly identifiable and somewhat plausible object, or effect, or event. More detailed rules at the end of the post.
Most "correct" (see above) prayers get answered - positively. If you didn't know any better, you'd swear your $DEITY was a Star Trek Computer + Replicator.
\$DEITY, $CUSTOMARY_PRAYER_STUFF, Please grant me Tea, Earl Gray, Hot.
DONE. Though, maybe I'll pour the tea on your head since you didn't pray for tea in a cup. The $DEITY is... easy to amuse and has a sense of humour of a 5 year old, at times.
\$DEITY, $CUSTOMARY_PRAYER_STUFF, Please grant me a tea-making machine that I don't have to refill with tea packets.
NOT done. Implementation isn't specific enough.
\$DEITY, $CPS, Please grant me and my wife 15 kids.
DONE. I'll amuse my divine self at your attempts to scrape together more than 5 consecutive minutes of sleep in the next 20 years.
\$DEITY, $CPS, Please grant me courage
DONE. Biochemical balance adjusted. Though, I'm tempted to VTC your prayer as too broad, as you didn't specify how much and for how long.
\$DEITY, $CPS, Please grant me immortality
NOT Done. Not specific enough and not really plausible.
\$DEITY, $CPS, IDDQD
NOT Done. Nice try, though.
\$DEITY, $CPS, Please give me the 12 gauge auto-loader; the 45 long slide with laser sighting; phase plasma rifle in 40-watt range and the Uzi 9mm.
DONE. Good luck to that dude to cut you off in traffic earlier
\$DEITY, $CPS, Please kill that a-hole who cut me off.
NOT done. Too generic.
\$DEITY, $CPS, Please kill that a-hole who cut me off, driving a truck with license plate I-DRIVE3; by blowing up his truck's gas tank with a lightning hit.
DONE. The level of specificity is good enough.
Oooooupsie! Anyone can pray for offensive wishes. Both to help them do harm on their neighbour, and to do said harm directly. As long as the wish is specific and plausible, it's almost guaranteed to be granted.
So... you have two choices:
Be an angel.
Remember Earthling Prophet R. A. Heinlein, with his "An armed society is a polite society. Manners are good when one may have to back up his acts with his life". Read his Holy Book of "The Moon is a Harsh Mistress".
And hope you don't inadvertently tick off anyone without meaning to (nearly impossible, if you go ahead and live a real life).
Try to wish for defensive prayers.
Now, here we run into a bit of an implementation issue.
As we saw above, really generic defensive prayers (invulnerability, immortality) won't get granted for lack of specifics and/or plausibility.
Generic/conditinal prayers won't work as well ("please make sure nobody pissed off at me today orders a prayer against me" - FAIL. "please make everyone like me today" - FAIL. "please prevent me from getting into any accidents" - FAIL. "please prevent my car from having lightning bolt strike its gas tank" - Granted. The $DEITY is curious if you remembered that one can ALSO pray for a meteor to fall on your head. Or a brick. Or for an RPG to shoot your car with).
So... what can be done to increase one's survival chances in such a society, where if someone wishes you harm, you are pretty much guaranteed to be D.E.D. as soon as they want to?
Extra prayer rules:
Prayers resulting in mass deaths won't be granted (say, anything killing >10 people total). So, no wishing for nukes or such, as a weapon or as an event.
Prayers asking to change prayer rules, and other such meta prayers, won't be granted.
Prayers that include SQL statements (ANY, ALL, and other such words being a tell-tale) won't be answered.
Prayers that read like a computer program with variables and controls statements might be rejected. "Please kill with a falling brick the first person who prays for my death today" won't work. You gotta name the person explicitly enough.
Accidental prayers won't be answered. "I wish my wife's head fell off", after a much-loved wife threw out your favourite sweater with holes, won't be granted, since $DEITY knows you didn't mean it and would instantly regret it.
One unorthodox way of increasing your prayer's chance of being answered, is to amuse the $DEITY somehow. But that's dicey - their sense of humor is... unpredictable, ranging from subtle irony to far less sophisticated.
Somewhat irrelevantly, prayers may be affected by how well you follow the commandments. BUT... commandments are few, and pretty trivial to follow. NOT your Biblical 10 commandments league. Things like "don't steal" (who needs to when anything you want can be prayed for). "Don't call $DEITY 'dude'". "Don't drive pink animals or pink cars".
Information request prayers may or may not be granted. To be granted, they have to be specific and plausible and fit other rules (e.g., wishing for a piece of paper with a recipe of pot pie in a restaurant X is granted. Wishing for the recipe itself won't work since "a recipe" isn't an object or event, just information. Wishing for the name of a person who wants to kill you won't work. Wishing for the name of the person who did something specific might work, but is dangerously close to "No SQL queries" prohibition).