Musnad Ahmad 1211
It was narrated that ‘Ali (رضي الله عنه) said:
The Messenger of Allah (ﷺ) said: “If two men come to you for judgement, do not rule in favour of the first one until you listen to what the other one says, then you will know how to judge.” He said: Since then I became a good judge.
حَدَّثَنَا حُسَيْنُ بْنُ عَلِيٍّ، عَنْ زَائِدَةَ، عَنْ سِمَاكٍ، عَنْ حَنَشٍ، عَنْ عَلِيٍّ، رَضِيَ اللَّهُ عَنْهُ قَالَ قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ إِذَا تَقَاضَى إِلَيْكَ رَجُلَانِ فَلَا تَقْضِ لِلْأَوَّلِ حَتَّى تَسْمَعَ مَا يَقُولُ الْآخَرُ تَرَى كَيْفَ تَقْضِي قَالَ فَمَا زِلْتُ بَعْدُ قَاضِيًا‏.‏