So when a miner adds transactions into a block + all required other data, they need to hash it to have a fingerprint of that block. hashing this data gives you like a random hash value wich everyone can do. To make it more difficult, the network has always a target that in order a blockhash is valid, it needs to be lower than that target (wich changes over time, depending on how many miners are trying) so only a block with a certain amount of leading zeros will be valid to be accepted by the network and get the blockreward + transaction feeās. In order to find a blockhash with some leading zeros, they need to add some extra random number into the block, hash it again and check if the hash is low enough (starting with a bunch of zeroās) when this isnāt the case, the miner needs to change the random number (nonce) and check again. Until they find a number (nonce) that will produce a block hash lower than target.
Check out:
https://andersbrownworth.com/blockchain/blockchain
But you will learn more about it later in this course