How exactly is the price of BTC determined?

BitcoinBitcoin
$23,959.47
3.25%
self.Bitcoin1m ago
How exactly is the price of BTC determined? Is it the amount of it that is off exchanges, in cold storage? Or is it just the amount the last person paid for it on the exchanges? The amount of buys means higher the amount of sales sends it lower? Confused as to what sets the price if anyone is in the know.