Gautama Buddha said this quote

So too, friend, purification of virtue is for the sake of reaching purification of mind; purification of mind is for the sake of reaching purification of view; purification of view is for the sake of reaching purification by overcoming doubt; purification by overcoming doubt is for the sake of reaching purification by knowledge and vision of what is the path and what is not the path; purification by knowledge and vision of what is the path and what is not the path is for the sake of reaching purification by knowledge and vision of the way; purification by knowledge and vision of the way is for the sake of reaching purification by knowledge and vision; purification by knowledge and vision is for the sake of reaching final Nibbāna [Nirvana] without clinging. It is for the sake of final Nibbāna without clinging that the holy life is lived under the Blessed One.