Lawful good

Lawful good characters upheld society and its laws, believing that these laws are created to work for the good and prosperity of all. They were both honest and benevolent, worked within power systems to change them for the better, and strove to bring order and goodness in a collective effort to better the world. They combined a commitment to oppose evil with the discipline[1] of a strict personal code of honor, or divine rules of conduct set down by their deity. If the situation arose, they would selflessly act by these codes even at the cost of their own life.[2]

Blind obedience to local laws was not required by those of the lawful good alignment. For example, a paladin would not be in violation of their alignment if they took up arms against the usurper of a throne, on behalf of the rightful king, even if it meant breaking the laws enacted by the usurper.[3]

It should be noted that a lawful good character did not actually have to obey all local laws, but rather preferred, a structured life to any other. Often times, this meant that a set of codified laws were followed.[2]

An incorruptible enforcer, a ruler or politician who acts for the good of his people, and a heroic soldier who strictly obeys the laws of battle are all examples of lawful good characters.[4]

A lawful good character obeyed the law and their code of morality.[1] Chaotic evil characters acted with no care for either of these.[5] These two alignments were in opposition.[6]
 * Opposing alignment

Paladins
Many Paladins swore oaths to their deities to uphold codes of conduct in line with the morality and lawfulness of their portfolio. As they drew their divine powers from their god, the maintenance of a lawful good alignment, and refraining from any evil acts, was required to retain their abilities and remain in good standing within their faith.[3][7]