Before revealing one option for pairing participants based on certain features, you should strongly consider @whuber's suggestion to use a totally random design. There are numerous benefits, both statistical and practical that are afforded by random assignment. For one, a random sample is easy to explain, and most people intuitively understand its value in experimental design. With random sampling any variation between the groups should be non-systematic in nature, and most statistical tests you would want to run are well-suited for these sorts of designs. In taking a random approach, you also avoid putting your finger on the scale by accident and ensure that your results are easily compared to future investigations of the same population using random designs. Any matching algorithm you use will necessarily be unique in some ways to your obtained sample, and may not be replicable in future cohorts.
That all being said, there is a package called
optmatch in R. An accessible review of its features can be found here. This is but one option out there, and before you use a tool like this, I strongly recommend testing it out on some simulated data so that you can fully assess the potential consequences of specific choices available to you.
Again, I would say that whenever possible, random assignment is the ideal choice, but there are some tools out there (like
optmatch) that can help in specific situations.