Typically,
For example, HTTPS handshake is basically, I get the Public Key of a website, generate a random password, encrypt it with Public Key and then send it to the website server and then website server uses Private Key to decrypt the password, so this password is shared. And further communication is encrypted using that shared password.
But really, public key isn’t just for encryption nor private for decryption, the otherway around works too, private key can be used for decryption and public key for encryption
One example that uses private key for encryption is digital signature, take some text/file, create a digest of test/file, encrypt the digest with private key and send the encrypted digest together with the text/file. Then if the public key successfully decrypt the encrypted digest and the digest matches then we know the test/file is the original, because the only key that can encrypt something that can be decrypt with public key is the private key.
The only reason public and private keys are not interchangeable is because you can recreate the public key from private key.