A public key is a cryptographic value, derived from a private key, that lets others send you cryptocurrency and lets the network verify your transactions. It produces the receiving addresses that you can share openly without putting your funds at risk.
The public key is generated from the private key through a one-way calculation, so it can be published while the private key stays hidden. From the public key, your wallet derives a shorter address, and when someone sends crypto to that address, the network records the funds as belonging to it. The network also uses the public key to confirm that a transaction was signed by the matching private key.
The private key is the secret half of the pair: it signs and authorises spending, while the public key only receives and verifies. Sharing a public key or address is safe; sharing the private key hands over control of the funds.
You ask a friend to pay you 0.25 units of crypto.
You share an address derived from your public key, and the friend sends to it:
public key derives to receiving address to friend sends 0.25 units
Anyone can see that address and send to it, but only your private key can later sign a transaction to move the funds out.