Members of the Jedi Order, from Jedi Masters to Padawans, were encouraged to follow a set of guidelines, including self-discipline, responsibility, and public service. These principles were put simply yet effectively in the Jedi Code:
Jedi are the guardians of peace in the galaxy.
Jedi use their powers to defend and protect, never to attack others.
Jedi respect all life, in any form.
Jedi serve others rather than ruling over them, for the good of the galaxy.
Jedi seek to improve themselves through knowledge and training.
The Jedi Code would help a Jedi stay on the right path and guide them away from the dark side.
The Mantra:
There is no emotion, there is peace.
There is no ignorance, there is knowledge.
There is no passion, there is serenity.
There is no chaos, there is harmony.
There is no death, there is the Force.
The Code was not necessarily a strict set of rules, but a general set of guidelines that Jedi were encouraged to keep in mind as they went about the business of the Order. Numerous Jedi teachings interpreted and expounded on the Code in subsequent millennia. These rules, created and embraced by the Jedi Masters, were essential tools in a Jedi's growth. In them, Jedi were encouraged to overcome personal obstacles such as pride and materialism, to understand their small yet important place in the galaxy, and to give every being and point of view equal consideration.