Alice encrypts the message with Bob's public key. After receiving the message, Bob decrypts it with his own private key, because Bob's private key is only owned by himself, and others can't see the content of the message, thus achieving the effect of confidentiality.
The whole process is that Alice encrypts the message with her private key, then encrypts the message with Bob's public key, and then sends the message. After receiving the message, Bob decrypts the message with his own private key to achieve confidentiality, and then decrypts the message with Alice's public key to verify the signature.