First you need to know what will be you matching key (i.e. first name + last name + e-mail). Once you have that, then setup your query against your entity that you want to check. This will be a slow process and have a lot of API hits as you need to take each record and do a fetch to find the matches. This means you could end up running the match multiple times unless you set a flag on the record that indicates it was already matched or you use the merge block to merge the similar records. Anyways, once you have your record you need to do a fetch to get all records with the same last name, first name and e-mail address. Within the fetch you can then run your merge. The fetch block only runs if it returns records.
the other option, if using an on-premise agent, this method will decrease the number of API calls, is to output the match keys (first name, last name, e-mail) to a file and do a match in excel. then pass a file back to another mapping that will merge the records together or do whatever you want.
Just remember that there is a rolling 5 minute, 60,000 API call limit to CRM. That is why I provided two different options, as I don't know how many records you are trying to go through.