فَمَنْ رَغِبَ عَنْ سُنَّتِي فَلَيْسَ مِنِّي
“Whoever turns away from my way is not of me.”
Man introduces a general conditional sense: “whoever.” Raghiba ʿan means to turn away. Laysa is a verb used to negate a nominal statement; minnī means “of me/from me.”
A useful distinction:
Raghiba fī — to desire or be interested in.
Raghiba ʿan — to turn away from or reject.
Changing the preposition changes the meaning substantially.