How should i connect database email to real email?

I am having a hard time coding the forgot password and how to make it work using a real email. the user needs to input his/her email and the once we recieve the email, we should provide a new password. can soemone help me? im using ajax and node js with vscode.

the ajax is running; its just the forgot password im worried of.
i already created a database email but i cant connect the real email to it. what should i do?