How do input and output VAT fit together?
The names are from the business's point of view: VAT on what goes out is output VAT, VAT on what comes in is input VAT. Every VAT return is the same sum: output VAT for the period, less input VAT for the period, equals what you pay or reclaim.
Output VAT is never your money. You collect it on HMRC's behalf and hold it until the return is due, which is why a healthy-looking bank balance in a VAT-registered business is partly an illusion. Input VAT, meanwhile, is money you have paid out and are entitled to get back, provided the purchase was for the business and you hold a VAT invoice for it.
Not everything carries VAT at the standard rate of 20%. Some goods and services are reduced-rated, zero-rated or exempt, and some costs, such as client entertaining and most cars, carry VAT you cannot reclaim. The bookkeeping job is recording the right rate on each transaction so the two totals are correct at quarter end.