“Pañcime, bhikkhave, āghātapaṭivinayā yattha bhikkhuno uppanno āghāto sabbaso paṭivinetabbo. Katame pañca? Yasmiṃ, bhikkhave, puggale āghāto jāyetha, mettā tasmiṃ puggale bhāvetabbā; evaṃ tasmiṃ puggale āghāto paṭivinetabbo. Yasmiṃ, bhikkhave, puggale āghāto jāyetha, karuṇā tasmiṃ puggale bhāvetabbā; evaṃ tasmiṃ puggale āghāto paṭivinetabbo. Yasmiṃ, bhikkhave, puggale āghāto jāyetha, upekkhā tasmiṃ puggale bhāvetabbā; evaṃ tasmiṃ puggale āghāto paṭivinetabbo. Yasmiṃ, bhikkhave, puggale āghāto jāyetha, asatiamanasikāro tasmiṃ puggale āpajjitabbo; evaṃ tasmiṃ puggale āghāto paṭivinetabbo. Yasmiṃ, bhikkhave, puggale āghāto jāyetha, kammassakatā tasmiṃ puggale adhiṭṭhātabbā — ‘kammassako ayamāyasmā kammadāyādo kammayoni kammabandhu kammappaṭisaraṇo, yaṃ kammaṃ karissati kalyāṇaṃ vā pāpakaṃ vā tassa dāyādo bhavissatī’ti; evaṃ tasmiṃ puggale āghāto paṭivinetabbo. Ime kho, bhikkhave, pañca āghātapaṭivinayā, yattha bhikkhuno uppanno āghāto sabbaso paṭivinetabbo”ti.

Bhikkhus, there are five ways of driving out hatred which will drive out any hatred that arises in a bhikkhu. What are the five?

When hatred arises towards a person, one should cultivate lovingkindness toward that person. In that way one drives out hatred for that person.

When hatred arises towards a person, one should cultivate compassion toward that person. In that way one drives out hatred for that person.

When hatred arises towards a person, one should cultivate equanimity toward that person. In that way one drives out hatred for that person.

When hatred arises towards a person, one should pay no mind to that person. In that way one drives out hatred for that person.

When hatred arises towards a person, one should consider the person’s actions this way: “That person’s bad actions belong to him; he will inherit the fruits of his actions; his actions are the womb from which he is born; his actions are his kin; his actions are his shelter; whatever actions he performs, for good or for evil, that’s what he’ll inherit.” In that way one drives out hatred for that person.

Indeed, bhikkhus, those are the five ways of driving out hatred which will drive out any hatred that arises in a bhikkhu.

Paṭhamāaghātapaṭivinaya Sutta, AN 5.161