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

living as a Hindu prince
living as a Hindu prince

living among religious ascetics
living among religious ascetics

meditating under the Bodhi Tree
meditating under the Bodhi Tree

enduring a life of suffering
enduring a life of suffering

rejecting extreme asceticism and self-indulgence.