"The Messenger of Allah ﷺ was asked about a man who fights out of bravery, one who fights out of protection (for himself or others), and one who fought to be seen. Which of them is in the cause of Allah ? He said: 'Whoever fought so that the Word of Allah is supreme, then he is in Allah's cause.'"
سُئِلَ رَسُولُ اللَّهِ ﷺ عَنِ الرَّجُلِ يُقَاتِلُ شَجَاعَةً وَيُقَاتِلُ حَمِيَّةً وَيُقَاتِلُ رِيَاءً فَأَىُّ ذَلِكَ فِي سَبِيلِ اللَّهِ قَالَ مَنْ قَاتَلَ لِتَكُونَ كَلِمَةُ اللَّهِ هِيَ الْعُلْيَا فَهُوَ فِي سَبِيلِ اللَّهِ