The method of Bitcoins working is linking a set of Blocks. This linked set of blocks record the Bitcoin transaction and finds out who ultimately has what Bitcoin. To ensure safe and secured Bitcoin transaction, there has to be some method to guarantee that no one can change the record of blocks. Mining and miners are the concept that accomplishes this task of keeping the record of blocks immutable.
Mining is more or less a guess work. A miner just takes the current sets of
Bitcoin transactions that have the link of last set of accepted transaction. A miner puts a number into the field of block header. This block header is passed through a one way or trap door function, popularly known as hash function. SHA 256 hash function is used twice. Now, if hash function output is below a threshold value, it is proved that the block is valid and is accepted by other miners. The miner is rewarded with 12.5 Bitcoins for his accurate guess work. This reward is known as block reward.
Actually, the miners are solving the problems of hashes of the next block. A hash in crypto graphic algorithm produces string of numbers and letters which are repeatable but irreversible. When a miner receives new transactions from network, he incorporates the transactions in next block data and goes on with hashing.