To understand how the Bitcoin protocol is able to work in a decentralized fashion, without any middlemen, let's take a simple example of how modern banking institutions function today.
Imagine you live in a small town where everyone starts off with $100 in cash in the form of paper money. Whenever you want to pay someone, you give them some of your paper money, and whenever you get paid, you receive paper money. The paper money serves as a basic form of accounting and makes intuitive sense. But the big insight that modern finance makes here is that you don't actually need the paper in order to do the accounting.
Imagine that there was a big chalkboard in the center of the town that kept track of everyone's cash balance. We'll call this chalkboard the ledger. In particular, the ledger has everyone's name with their balance in dollars right beside it.
Now imagine that every time you wanted to pay someone, you could just go to the ledger and subtract the amount from your balance, and add it to their balance. And vice versa whenever you wanted to get paid. If you did this, then you'd have all the accounting that the paper money afforded you previously, but without the paper. Here is a concrete example:
This concept is exactly how modern banks work today — only digitally. Anytime you want to make a transaction, you tell your bank and your bank checks its database, which is just a digital ledger, to make sure it's legitimate. And if it is, your account is debited and someone else's is credited.