How does Bitcoin work when someone opens a wallet and gets a private key? Who stores that data? How could you access it if your forgot it?
Usually your private keys are stored only on your computer, in an encrypted file. If you lose them, your bitcoins are lost. That is why it is important to take a backup of your seed words or wallet file. If you use a website wallet, the owner of that website stores your keys, which means you must trust them and risk that they will not be hacked, etc. which goes against bitcoin principles - don't trust, just verify. So it's important that you keep your private keys safe somewhere that you can access, don't let a website keep them from you.
how is it verified when someone exchanges bitcoin and dollars? Because the owner of those bitcoins has to change but there is obviously no proof in the system he has done that transaction
Of course there is proof - every transaction is recorded in the blockchain forever. So every transaction can be seen by everyone else on the network, everyone knows the bitcoins have exchanged owners (technically they can't know whether they've exchanged owners or just moved to a new address though, of course)