منwhoever صَحِبkept company with الدنياthe world وَلَمand did not يَستَفِدbenefit
من صَحِب الدنيا وَلَم يَستَفِد
منهاfrom it ولمand did not يَعملact بماon what يَعلَمُhe knows
منها ولم يَعمل بما يَعلَمُ
Whoever keeps company with the world and gains no benefit
from it, and does not act on what he knows,
كانwas كَمَنlike someone حدَّثَتهُyou told him قصَّةًa story
كان كَمَن حدَّثَتهُ قصَّةً
يَسمعهاhe hears it رَمزاًas a riddle ولاand does not يفهمُunderstand
يَسمعها رَمزاً ولا يفهمُ
is like someone to whom you have told a story:
he hears it as a riddle and does not understand.