Its a simple System you just have to understand 2 Types of Orders.
1. the Limit Order: You put a buy order at a price where at the moment nobody wants to sell for and in the moment someone wants to sell for that price you buy.
2. a market Order: You put a buy order on the price someone want to sell, so you instantly buy from him.
with sell orders its the same thing.
A little example:
Person A wants to sell 1 BTC for a price of 500USD but in that moment the price is at 450 USD so noone buys it now. He put a Limit order at 500 USD and his coins are in the order book from that moment.
Person B later wants to buy 1 BTC. At this moment Person As order is the cheapest in the Order Book and B decides to buy for the 500USD. Then he makes a market Order and the trade is perfect. Person A gets 500USD and Person B gets 1BTC. If Person B wants to buy 2 BTC then he buys 1 BTC from Person A for the price of 500 and lets say the next in the order book sells 20BTC for 501 then he buys the other 1 BTC for 501.
I hope that helps you