Sidhartha Gautama was able to discover the Middle Way and enlightenment by:

1. Leaving his life of luxury: Siddhartha Gautama was born into a wealthy and privileged family. However, he realized that material possessions and wealth did not lead to lasting happiness and contentment. Therefore, he left behind his life of luxury, including his wife and child, in search of a deeper meaning to life.

2. Practicing extreme asceticism: Siddhartha Gautama studied under various spiritual teachers and practiced extreme forms of self-denial and austerity, believing that by depriving the body of its physical needs and pleasure, he would achieve enlightenment. However, he soon realized that this extreme path did not lead him to enlightenment either.

3. Engaging in meditation: Siddhartha Gautama then sought a balance between indulgence and asceticism and began practicing meditation. He spent years meditating and reflecting upon the nature of suffering, the human condition, and the causes of dissatisfaction. Through his deep contemplation, he began to gain insights into the true nature of reality and the path to liberation.

4. Attaining enlightenment: After years of intense meditation and self-reflection, Siddhartha Gautama finally achieved enlightenment under a Bodhi tree in Bodh a, India. During this moment, he experienced a profound understanding of the nature of suffering, the cycle of birth and death, and the path to liberation from suffering. He became the Buddha, which means "the awakened one."

5. Teaching the Middle Way: The Buddha's enlightenment experience led him to develop the concept of the Middle Way, which rejects both extreme indulgence and extreme asceticism. He taught that true enlightenment comes from finding balance and moderation in all aspects of life. This Middle Way became one of the core teachings of Buddhism.

6. Spreading his teachings: After attaining enlightenment, the Buddha spent the rest of his life traveling and teaching his insights to others. He founded a monastic community of monks and nuns to carry on his teachings and established the framework of Buddhist philosophy and practice. His teachings on the Middle Way, the Four Noble Truths, and the Eightfold Path continue to guide and inspire millions of people around the world.