If your license expired more than two years ago, you will have to apply for an original license. That means you must pass the vision test and the written test, complete the pre-licensing course and pass the road test all over again. To do all this, you must make an appointment at the DMV and go to a DMV location in person. You can find a DMV location near you here. Depending on the class of your license, the steps to follow and documents required might differ.
Ideally you should renew your license before it expires or you could face fines. If you drive with an expired license and get a traffic ticket, you will receive fines and penalties:
60 days or less after the expiration date: $25 to $40 plus state and local surcharges
More than 60 days after the expiration date: $75 to $300 plus state and local surcharges
Be aware that due to COVID-19, all licenses with an expiration date of March 1, 2020 or later have been extended until further notice. Make sure to check the latest NY state updates about this extension during the public health crisis.
For more information on how to renew your license, check this page.