Go to the contacts app on the mac > click “Card” > select “Look for duplicates”.
Now you have to wait for a moment, then the system will tell you how many duplicates you have in your iPhone.
You will see a pop up and asking to merge duplicate contacts.