A distributed consensus achieves agreement on a proposal or assures data consensus among nodes in a distributed system. A consensus algorithm is the process through which a blockchain network comes to a consensus.
Since public (decentralized) blockchains are distributed systems rather than centralized ones, the dispersed nodes must concur on the legitimacy of transactions. Consensus methods are useful in this situation. They guarantee that all transactions take place in a trustless manner and that the protocol rules are being adhered to, ensuring that the coins can only be used once.