I overstayed in U.S. for 2 years and was recently denied a U.S. visa, what should I do?

Since you overstayed for almost 2 years, you are considered inadmissible to the U.S. and you are automatically subject to a 10 year bar from returning to the U.S. However, there is hope. You may apply for a waiver of inadmissibility (I-192 and/or I-212, depending on your situation). I presume that you have disclosed this fact when you applied for your visa. In reapplying, you should make a waiver request together with your visa application. If, however, you did not disclose that you overstayed in the U.S. and your visa was denied on the ground of overstay, then you had committed a misrepresentation, which forms another ground of inadmissibility. Although you may still apply for a waiver to overcome this admissibility, the application is more difficult to be approved. In any case it is recommended that you hire a competent lawyer familiar with U.S. immigration law to assist you with the waiver application.