Unprocessed transactions are broadcast across the Bitcoin network. A miner collects together a block of transactions and the hash of the last known block. They add an arbitrary “nonce” value, then calculate the hash of the resulting block. If that hash satisfies the current difficulty criterion, they have mined a block! This successful block is then broadcast to the network, who can quickly verify the block is valid. The miner gets 12.5 BTC plus the transaction fees. If they failed, they pick another nonce value and try again.