The macOS password is hashed (a one way scrambling of the password that cannot be reversed).
when you enter your password to unlock your mac, the password is hashed the same way and compared against the stored hash.
The login code will not accept the has as input, only the password, so it is possible to know the hash, but not be able to use it.
And so there can be no lookup table of known passwords and hashes, each time you change your password, a unique “salt” is created which us used in the hash algorithm to randomize the hash, so that every user that decides to use the password “123456” will each generate a unique hash value.
Because of the unique “salt”, that means the only attack is a brute force attack, trying all password combinations. But macOS locks the account after too many login failures.
You cannot get your password back. You can only reset it to a new value. And to do that, if you have FileVault enabled is to know your FileVault encryption key, or to have allowed macOS to encrypted it with your Apple ID password, then stored in iCloud.