Ethereum currently uses a Proof of Work consensus mechanism. Which means it requires 24x7 mining in order to keep the network running.
So, if you're new to cryptocurrencies, you may have wondered what an Ethereum miner does, exactly.
The whole point of mining is to verify that only valid transactions are accepted and also to reach a network-wide consensus.
Each Ethereum block must get verified to make sure it only contains valid transactions.
Each Ethereum transaction can only consume valid and unspent outputs (UTXO's) - and it may only consume each UTXO once, otherwise you would end up with double-spends.
Once all transactions in a block are validated, miners then race to find an adequate hash code for the block header. The purpose of this "race" is to reach a consensus within the network.
Verifying transactions is the easy part. The real hard part in running a decentralized cryptocurrency network is to make sure everyone agrees on the same transactions and, therefore, the same balance.
If one set of nodes agrees on a certain block and a different group agrees on another, they might end up with different transactions approved. Even if all transactions are valid! For example, a valid transaction may be left out until a future block, which would cause a different balance for that Ethereum account until that future block is mined.
To solve this, all miners must find the solution to a cryptographic puzzle called a hash code.
The hash code is a very large number that is computed for the Ethereum block header. If this hash code is smaller than a preset amount, it's considered valid.
When someone finds such a hash, it is said they've solved the block. It then broadcasts this magic number so everyone agrees that only this number is correct. Therefore, only the blocks which match this number are considered valid. This way everyone ends up with the same block, making sure ETH balance is equal for everyone on the network.
The new generation of the Ethereum platform, AKA Ethereum 2.0, will use the Proof of Stake consensus mechanism.
In this new system, the amount of coins held by each "miner" is used as a proof of value, instead of requiring expensive mining hardware.
With ETH 2.0, all the current Ethereum mining hardware will become obsolete. So if you were planning on starting an Ethereum mining operation now, you may want to put it on hold until after ETH 2.0 is released.
This is the very basic overview of what Ethereum mining involves.
As you can imagine, there are endless technical details involved in all this, from setting up the proper mining rig to keeping the whole mining operation running 24x7.
If you wish to learn more about Ethereum mining, see the links below for more details.