The Buddha uses the simile of bonfire to explain how perceiving gratification in objects that can be grasped at leads to clinging, to suffering, and how perceiving drawbacks in objects that can be grasped at leads to the cessation of clinging, to the cessation of suffering.
At Sāvatthi.
"Bhikkhus, when one dwells perceiving gratification in objects that can be grasped at (clung to, taken possession of), craving increases. Dependent on craving, there is clinging; dependent on clinging, there is becoming; dependent on becoming, there is birth; dependent on birth, there arises aging and death, sorrow, lamentation, pain, displeasure, and despair. Thus there is the arising of this entire mass of suffering.
Just as, bhikkhus, if a great bonfire were burning and blazing from ten, twenty, thirty, or forty cartloads of wood, and a person from time to time were to throw dry grasses, dry cow dung, and dry sticks onto it, that great bonfire, being fueled and sustained by that, would burn and blaze for a long time.
In the same way, bhikkhus, when one dwells perceiving gratification in objects that can be grasped at (clung to, taken possession of), craving increases. Dependent on craving, there is clinging; dependent on clinging, there is becoming; dependent on becoming, there is birth; dependent on birth, there arises aging and death, sorrow, lamentation, pain, displeasure, and despair. Thus there is the arising of this entire mass of suffering.
Bhikkhus, when one dwells perceiving the drawbacks in objects that can be grasped at, craving ceases. From the cessation of craving, there is the cessation of clinging; from the cessation of clinging, there is the cessation of becoming; from the cessation of becoming, there is the cessation of birth; from the cessation of birth, aging and death, sorrow, lamentation, pain, displeasure, and despair cease. Thus there is the cessation of this entire mass of suffering.
Just as, bhikkhus, if a great bonfire were burning and blazing from ten, twenty, thirty, or forty cartloads of wood, and a person were to not throw dry grasses, dry cow dung, and dry sticks onto it from time to time, that great mass of fire, being depleted of the former sustenance and not provided with any new fuel, would be extinguished.
Just so, bhikkhus, when one dwells perceiving the drawbacks in objects that can be grasped at, craving ceases. From the cessation of craving, there is the cessation of clinging; from the cessation of clinging, there is the cessation of becoming; from the cessation of becoming, there is the cessation of birth; from the cessation of birth, aging and death, sorrow, lamentation, pain, displeasure, and despair end. Thus there is the cessation of this entire mass of suffering."
Related Teachings:
What is Dependent Origination? (SN 12.1) - The Buddha explains the dependent origination, the arising and cessation of suffering.
The appearance and dissolution of the world (SN 12.44) - The Buddha explains on the appearance of the world and its dissolution through sense contact and dependent origination.
Descent of consciousness | independently verifying suffering and its ending (SN 12.59) - This is a teaching that is pointing to how one breaks through seeing the second and third noble truths through practice.