how does a block know that its transactions have tampered with in the
It is not the block that knows this; it is the nodes which verify that.
To quote the bitcoin whitepaper:
When a node finds a proof-of-work, it broadcasts the block to all
nodes. Nodes accept the block only if all transactions in it are valid
and not already spent.
Blocks include more than just those 3 variables. One of the most important ones is the merkle root. This is the hash of all of the transactions in the block, in a particular order. If different transactions are included or they are included in a different order, that merkle root is going to be different. So if each miner has a different merkle root, then ...