I found that a method I was hoping to publish is already known. What would be a proper way to retract emails sent to professors asking for help?
Don't worry, we do that all the time (figuring out something has been done/shown before). It actually shows that you do your work.
Maybe give a link to the other solution/work as well in case they are interested (though this is coming from a very different field).
This is actually excellent - it shows you're doing due diligence and that you're willing to be wrong. I would expect the professors to be legitimately impressed.
I would write something like 1) sorry for the hype the original email included, because 2) I found out it's already been done before and here's the link, and 3) thanks for your time. Who knows, they might say your derivation is publishable anyway.
This happened to me as well and is absolutely not uncommon in my field (maths). It did not prevent my paper to be published. So I would not worry at all. Actually, this is great because it is very unlikely that you both have exactly the same results so you may even be able to enrich your own results with new light on a similar problem.
You could add a discussion (which can potentially be just a couple of sentences) in the paper that goes along these lines:
" A similar approach was derived indepedently in [?]. However, blabla"
where blabla = some difference in the approach itself, in the observations about this approach, in the applications of this approach or provides a simpler/different proof, etc.