Two teachers
The Ariyapariyesanā Sutta says Gotama first studied under Āḷāra Kālāma, who taught a meditation leading to 'the dimension of nothingness', and then under Uddaka Rāmaputta, who taught one leading still further. He mastered both, and both teachers invited him to lead with them. He left each, because these states did not end suffering.
The austerities
He then practised extreme self-mortification. In the Mahāsaccaka Sutta he describes holding his breath until his head roared, and eating so little that his body wasted away, his spine showing like a row of beads and his eyes sinking deep in their sockets. Five fellow ascetics joined him, expecting him to succeed.
It brought him close to death, but not to understanding. He concluded that no one could go further in austerity than he had, and that it was not the way.
A different way
Then he remembered a day in his childhood, sitting in the cool shade of a rose-apple tree while his father worked, when his mind had settled into a calm, joyful absorption. Might that be the path? He decided to eat again to regain his strength. His five companions left him in disgust, thinking he had given up.
This turn away from both indulgence and self-torment became what the Buddha later called the middle way.
Why it matters
This becomes central to the Buddhist rejection of both indulgence and destructive asceticism.
History and tradition
What historians can say
The account of the two teachers and the austerities comes from early discourses and is widely treated as reflecting real practices of the time. The names of the teachers are not known from any other source, and the traditional figure of six years is not given in these early passages.
What Buddhist tradition remembers
Later tradition tells that a young woman, Sujātā, offered him a bowl of milk-rice before his awakening, and an early poem, the Padhāna Sutta, describes Māra, the tempter, urging him to give up his striving.