Bad idea - very bad.
The only way to do that is to store user passwords: and that's insecure.
Never store passwords in clear text - it is a major security risk. There is some information on how to do it here:
Password Storage: How to do it.[
^]
And remember: if this is web based and you have any European Union users then GDPR applies and that means you need to handle passwords as sensitive data and store them in a safe and secure manner. Text is neither of those and the fines can be .... um ... outstanding. In December 2018 a German company received a relatively low fine of €20,000 for just that.
Instead of "here is your password", you set a temporary password (which expires after say 24 hours) and allow them to log in with either that (in which case you set that as the new password and allow them to change it) or with the original (in which case you discard the temporary one).
I like to use a Guid, because nobody wants to type it and that encourages them to set it to a new value ...