Cash flow is the key driver for a business: without cash, the business will die. A business can be profitable, but still cashflow negative. What to do if a customer won't pay you?

Your invoices should contain a summary of terms of trade - including payment terms - e.g. Pay within 14 days
There are a number of ways to get payment - this is the Escalation Approach:
Customer (or bad supplier) is within the same country as you are
Call them: Call up the manager of the company and ask what is the problem that's causing non-payment. Follow up the email with the agreed actions - including the timeframe for these actions
If calling them fails, Email them a polite request for payment. At this time, we are still in the "speak softly" mode: Its best to make this a nice and friendly approach. When composing the email, turn on the tracking options to ensure that you know its been received and read. Move the email and the tracking responses to a folder in your Email account
If Emailing fails, send them a Final Demand. Firstly, determine the total amount of debt owed: how many months the debt is owed and any interest due: the formula to calculate interest is [debt] *(1+([Interest rate as %]/12). ITs worth googling the criteria take it to a "Small claims" tribunal/court in your country or to escalate it. Put this in the wording - e.g. "If you don't pay within 14 days, I will file at the Disputes Tribunal for payment". If you know the company's auditors and/or accountant, then copy them into this email to gain more attention.
Sue them! If you have an existing relationship with a debt collection agency, then pass the debt to them for collection! Otherwise you need to sue them. Google "How to sue for debt collection + [country], or search in your country's "Justice Ministry" website. This will give guidelines on which legal process your debt (calculated in Step 3) will go through. If it is a "small" - amount, this can usually be done on a self-serve process without the need for lawyers. You may need to follow an initial process to issue a Final Demand - this will involve completing a PDF/Word form and emailing it to them: this can be done as part of Step 3 to expedite!
International
We recently had a case where we'd paid a foreign supplier for training which wasn't received. The process involved was very similar, but we googled the supplier's home country Justice Ministry and followed that process