Go see a lawyer, if for nothing else than the free consult to get a brief outline of the many issues. There are too many paths to take from this point to discuss in this forum.
If I understand this brief statement correctly, you are the husband but not the father of a child. Your wife had an affair with another man who is the biological father of the child.
I will take it that at some point DNA testing was done to confirm this. If not the case, then there are more issues that need to be addressed.
But for a basic answer, look to the first attorney's answer. The biological father can file with the court seeking to establish his rights to the child. IT IS A VERY CONTENTIOUS AREA OF FAMILY LAW that is not something you wish to do on your own. And I would recommend that you and your wife have separate attorneys due to the complexity of the issue.
I would also reccomend that you do not put off the consultation for too long, as if you are looking for advice here, then the issue is not far on the horizon where the court is going to be a factor.
Sign up to receive a 5-part series of useful information and advice about child custody law.