Simple answer:
don't.
In order to retrieve the password, you would have to store the password in plain text, or using a reversible encryption algorithm. Neither option is acceptable for storing users' passwords.
Store a salted hash of the password, using a unique salt per record, and multiple rounds of a secure hashing algorithm.
Secure Password Authentication Explained Simply[
^]
Salted Password Hashing - Doing it Right[
^]
PHP even has built-in methods to help you do the right thing:
PHP: password_hash[
^]
PHP: password_verify[
^]
99% of YouTube programming videos aren't worth the paper they're printed on. The one you're following doesn't sound like it's made it to the other 1%.