The Buddha explains the process of thoroughly investigating the arising and cessation of suffering through dependent co-arising.

Parivīmaṁsana sutta - Thorough Investigation

Thus have I heard - At one time, the Blessed One was dwelling in Sāvatthī, in Jeta's Grove, Anāthapiṇḍika's Park. There the Blessed One addressed the bhikkhus: "Bhikkhus!"

"Venerable sir," the bhikkhus replied. The Blessed One said this:

"Bhikkhus, to what extent should a bhikkhu investigate thoroughly for the complete ending of suffering?"

"Venerable sir, our teachings are rooted in the Blessed One, guided by the Blessed One, and have the Blessed One as their refuge. It would be good if the Blessed One would clear up the meaning of this statement. Having heard it from the Blessed One, the bhikkhus will remember it."

"Then, bhikkhus, listen to this and pay close attention, I will speak."

"Yes, venerable sir," those bhikkhus replied to the Blessed One. The Blessed One said this:

"Here, bhikkhus, a bhikkhu investigating thoroughly reflects: 'What is the source, what is the arising, what is the characteristic, and from what do the various kinds of suffering that arise in the world [headed by] aging and death come into being? When what is present do aging and death arise, and when what is absent do aging and death not arise?' Investigating thoroughly, he understands: 'The various kinds of suffering that arise in the world headed by aging and death, have birth as their source, birth as their arising, birth as their characteristic, and they come into being from birth. When birth is present, aging and death arise; when birth is absent, aging and death do not arise.'

Thus, he understands aging and death, the arising of aging and death, the ending of aging and death, and the way of practice that is suitable for leading to the ending of aging and death. He then practices and lives according to the Dhamma. This, bhikkhus, is called a bhikkhu who has fully and rightly entered upon the path for the complete ending of suffering, for the ending of aging and death."

Then, investigating further, he reflects: 'What is the source of this birth, what is its arising, what is its characteristic, and from what does this birth come into being? When what is present does birth arise, and when what is absent does birth not arise?' Investigating thoroughly, he understands: 'This birth has existence as its source, existence as its arising, existence as its characteristic, and it comes into being from existence. When existence is present, birth arises; when existence is absent, birth does not arise.'

Thus, he understands birth, its arising, its ending, and the way of practice that is suitable for leading to the end of birth. He then practices and lives according to the Dhamma. This, bhikkhus, is called a bhikkhu who has fully and rightly entered upon the path for the complete ending of suffering, for the ending of birth.

Then, investigating further, he reflects: 'What is the source of this existence, what is its arising, what is its characteristic, and from what does this existence come into being? ... What is the source of this clinging? ... What is the source of this craving? ... What is the source of this sensation? ... What is the source of this contact? ... What is the source of these six sense bases? ... What is the source of this name and form? ... What is the source of this consciousness? ... What is the source of these volitional formations? What is their arising, what is their characteristic, and from what do they come into being? When what is present do volitional formations arise, and when what is absent do volitional formations not arise?' Investigating thoroughly, he understands: 'These volitional formations have ignorance as their source, ignorance as their arising, ignorance as their characteristic, and they come into being from ignorance. When ignorance is present, volitional formations arise; when ignorance is absent, volitional formations do not arise.'

Thus, he understands volitional formations, their arising, their ending, and the way of practice that is suitable for leading to the end of volitional formations. He then practices and lives according to the Dhamma. This, bhikkhus, is called a bhikkhu who has fully and rightly entered upon the path for the complete ending of suffering, for the ending of volitional formations.

Bhikkhus, when a person immersed in ignorance generates a meritorious volitional formation, their consciousness is directed towards a meritorious destination. If they generate a demeritorious volitional formation, their consciousness is directed towards a demeritorious destination. If they generate an imperturbable volitional formation, their consciousness is directed towards the imperturbable. But bhikkhus, when a bhikkhu has abandoned ignorance and aroused wisdom, then, with the fading away of ignorance and the arising of wisdom, they neither generate meritorious volitional formation, nor demeritorious volitional formation, nor an imperturbable volitional formation. Not generating, not intending, they do not cling to anything in the world. By not clinging, they are not shaken up. By not being shaken up, they personally attain final Nibbāna.

They understand: 'Birth is ended, the spiritual life has been lived, what had to be done has been done, there is no more coming to any state of being.'

If he experiences a pleasant sensation, he understands: 'It is impermanent,' he understands: 'It is not clung to,' he understands: 'It is not delighted in.' If he experiences a painful sensation, he understands: 'It is impermanent,' he understands: 'It is not clung to,' he understands: 'It is not delighted in.' If he experiences a neither-painful-nor-pleasant sensation, he understands: 'It is impermanent,' he understands: 'It is not clung to,' he understands: 'It is not delighted in.' If he experiences a pleasant sensation, he experiences it disentangled. If he experiences a painful sensation, he experiences it disentangled. If he experiences a neither-painful-nor-pleasant sensation, he experiences it disentangled.

Experiencing a sensation terminating with the body, he understands: 'I am experiencing a sensation terminating with the body.' Experiencing a sensation terminating with life, he understands: 'I am experiencing a sensation terminating with life.' He understands: 'With the breakup of the body, following the exhaustion of life, all that is experienced, not being delighted in, will become cool right here; merely body remains will be left.'

Suppose, bhikkhus, a person might take a hot pot from a potter's furnace and place it on a level surface: its heat would dissipate right there and pottery shards would remain.

So too, bhikkhus, a bhikkhu experiencing a sensation terminating with the body understands: 'I am experiencing a sensation terminating with the body.' Experiencing a sensation terminating with life, he understands: 'I am experiencing a sensation terminating with life.' He understands: 'With the breakup of the body, following the exhaustion of life, all that is experienced, not being delighted in, will become cool right here; merely body remains will be left.'

What do you think, bhikkhus, can a bhikkhu whose mental defilements are ended generate a meritorious volitional formation, a demeritorious volitional formation, or an imperturbable volitional formation?"

"No, venerable sir."

"Or further, when there are utterly no volitional formations, with the ending of volitional formations, could consciousness be discerned?"

"No, venerable sir."

"Or further, when there is utterly no consciousness, with the ending of consciousness, could name and form be discerned?"

"No, venerable sir."

"Or further, when there is utterly no name and form, with the ending of name and form, could the six sense bases be discerned?"

"No, venerable sir."

"Or further, when there are utterly no six sense bases, with the ending of the six sense bases, could contact be discerned?"

"No, venerable sir."

"Or further, when there is utterly no contact, with the ending of contact, could sensation be discerned?"

"No, venerable sir."

"Or further, when there is utterly no sensation, with the ending of sensation, could craving be discerned?"

"No, venerable sir."

"Or further, when there is utterly no craving, with the ending of craving, could clinging be discerned?"

"No, venerable sir."

"Or further, when there is utterly no clinging, with the ending of clinging, could existence be discerned?"

"No, venerable sir."

"Or further, when there is utterly no existence, with the ending of existence, could birth be discerned?"

"No, venerable sir."

"Or further, when there is utterly no birth, with the ending of birth, could aging and death be discerned?"

"No, venerable sir."

"Good, good, bhikkhus. Thus it is, bhikkhus, it is not otherwise. Have faith in me on this, bhikkhus. Accept it with firm resolve. Be free from perplexity and doubt about this. This is the end of suffering."