To understand how the blockchain avoids double-spending, know that since the delivery of the first Bitcoin block in 2009, the Bitcoin blockchain keeps a complete record of each transaction. Since all transactions are tied to the previous blocks, you cannot merely modify the record.
This record is called blockchain because a new group of transactions, called a block, is added every ten minutes. Blockchain avoids double-spending by time-stamping groups of transactions, then distributing them to all nodes of the bitcoin network. Since the transactions are time-stamped on the blockchain and linked mathematically to the previous ones, they are irreversible and impossible to modify.
Proof of work is key to avoiding double-spending in an untrusted network. In this network, the participants don’t need to know who submitted the block, and it is enough to confirm the proof of work with the network. Miners must find this proof of work. That’s what they do with their massive installations and equipment, day and night, counting in the hope of reaching the next block. Once this block is found, it is then broadcast on the network. This allows the miners and the nodes to verify that the block has been submitted correctly.