How much do you already know?
You need to know handling form data, making a database query based on that data, and the [man]mail[/man] function. If you store the password as plain text you can email it back to them, otherwise you could create a new random one, set their password to that with a database query (possibly hashed in some way) and then email them the new one, letting them change it when they log in.