How are Private Key, Public Key and Wallet Address Generated?

I recently started learning Web3, and one of my first questions was: How are private and public keys generated, and how do you get a wallet…