The Goal of Meditation is often seen as the Ultimate Goal aimed at with Buddhist Practitioners. Vipassana is often mistaken for Samatha Meditation, and Both are often mistakenly thought of as the Mission at hand. Meditation practice, and it’s highest states are however, not the goal of goals.
The Lord Buddha reached these Meditative Attainments to their full capacity with his 2 Lersi teachers. This did not Enlighten Him or release him from Samsaric wheel of Rebirth, which was of course his aim and goal from the beginning.
The purity and stainless mind which comes with Buddhahood or Arahantship however, was not his goal at the beginning, for it was only later as meditative ability and insight, along with the experiences leading to his realization of the middle path. The middle path is a Dhamma he realized some time before his enlightenment.
The realization of the middle path, and the confrontation with the stains of wrong view which obscured the Dhamma from the eyes of all Beings in Samsara, is what led him to begin the quest for removal of impurities, which leads to Arahantship). After attaining the Meditative Jhanas in all their possible levels, the Buddha realized that this would take him no further, and so he left to tarry onwards, for it was the presence of stains, kilesa, impurity, defilement and wrong views which was the goal (to remove them).
This was he goal, not meditation. meditation lets you see the defilement stains or kilesa arising from false views of reality, and that is what is then going to lead you to conclude what needs to be removed to become free and see clearly.
Selfishness is what has to be removed, for selfishness arises from the false view of a separate self.. removal of this false view will remove the selfishness that comes from the false view of a self.
So the way to remove Kilesa, is to remove Avijja (false views) this is done with Vipassana (insight development). Successful Manifestation of the Practice as a Fully Realized Innate Natural Poise is the true correct practice of the 8 fold path.