The Jedi Code was a code of conduct that sought to manage the behavior of the Jedi Order. Within its words, the Code emphasized the importance of being able to control your emotions, ultimately aiding individuals in resisting the temptations of the dark side of the Force. The Code was also specific on how Jedi were expected to live, with them being forbidden to form attachments, something which Grand Master Yoda would always remind Jedi of. Attachments had the potential to lead to greed, loss, and jealousy, things that would undoubtedly draw even the strongest of Jedi towards the dark side. Contrary to popular belief, Jedi were still permitted to feel romantic feelings for an individual, as well as familial love. They were not, however, allowed to act upon these feelings. Compassion was at the heart of every Jedi, they just required the restraint to go along with it. Most importantly, the Jedi Code forbade Jedi from killing unarmed opponents as well as seeking revenge. Jedi were expected to be modest, humble, and selfless.
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.
Believed to have been written by Odan-Urr, the Code has had numerous versions over the course of history. Despite this, the core fundamental values that the Code represents have always remained constant.
Within the lines of the Jedi Code, some lessons should be learned by all aspiring Jedi. These lessons consisted of:
Conquering the Dark Side - At a young age, Jedi were taught to acknowledge the dark side within themselves and accept it. Loss, love, anger, hate, jealousy, greed, and aggression were all paths to the dark side, so Jedi were taught how to prevent these feelings from conquering them through the use of training, and patience. Similar teachings can also be found in the Three Pillars, with the third Pillar - Self-Discipline - emphasizing the importance of having control over emotions.
Emotions and serenity - Following on from having control over emotions, Jedi were encouraged to focus more on relying on their instincts compared to their mind. Although emotions were valuable to a Jedi, they were also dangerous. A clouded judgment could be the deciding factor as to whether a Jedi walked the path of the light or the dark. To prevent this, the Jedi were taught to maintain a serene, quiet mind to maintain a balance of the Force within themselves.
Love and attachment - As keepers of the peace, Jedi were trained to love in terms of compassion, without the risk of forming an attachment. Compelling feelings toward an individual led to attachments, in turn leading to an inability to accept change as the core characteristic of life. It is because of the potential repercussions of attachment that Jedi were taught to let go of everything that they were afraid to lose, for them to love the entirety of life unconditionally, without forming selfish attachments. This is especially apparent between Masters and Padawans, who create a familial bond with each other throughout their time together. They had to be prepared to let each other go, and not neglect their foremost duties as Jedi.
Peace with death - Ultimately, the Jedi knew that eventually, all living things must die. They knew this to be the will of the Force, and that death doesn’t mean that an individual is gone forever. The Jedi were well-versed in the aspects of the Force and found comfort in knowing that death is just a transitional period as an individual ascends from the Living Force and becomes one with the Cosmic Force. Despite the saddening emotions that come with death, Jedi were reminded that everyone will pass on one day, becoming reunited with those who had made the transition before them.