There was indeed in them(5418) an excellent example for you to follow,- for those whose hope is in Allah and in the Last Day. But if any turn away, truly Allah is Free of all(5419) Wants, Worthy of all Praise.
5418 In them: i.e., in their attitude of prayer and reliance on Allah, and of dissociation from evil. 5419 If anyone rejects Allah's Message or Law, the loss is his own. It is not Allah Who needs him or his worship or his sacrifice or his praise. Allah is independent of all wants, and His attributes are inherently deserving of all praise, whether the wicked give such praise or not, in word or deed.