I think this question is way too deep to be able to answer in one blog post. The Bible, the Quran, the Heart of Buddha's teachings, the Art of Happiness, etc. are pretty large books that dive into the potential that humans have to achieve peace. Some people use the term joy to mean happiness, but in the context of this post, the term joy is the same as peace. The main point that I want to make, and discuss, is that: in order to achieve joy, we must have the awareness and understanding to determine the difference between thoughts and reality.
Thoughts are unavoidable, but they aren't reality. Thoughts are often (possibly always) the reason that humans experience some form of depression or anxiety. Being able to recognize a thought is a skill that we will always have to strive for. No matter how good we get at it, thoughts can easily slip into our minds as a conscious reality.
I think the ability to achieve joy comes from the process of acknowledging a thought as just a thought, rather than letting it become a false reality.