There are a few ways I have seen freelancers address this issue. These are all good but they approach the problem from different angles. In general there are two problems for big projects for freelancers:
You don't want to wait to the end of the project to get paid, and
You don't want to have trouble collecting on a large project.
So with this in mind you have a couple options. Which you choose depends on what you are comfortable with and there are probably others, but these are the most common.
Of course "large" is relative. Here I am assuming "large means over a 1 man month of work." I have had several projects which are large by that standard.
Option 1: Require a retainer
If you do the project on retainer, the client pays for a certain amount up front, and then refills their account as the project progresses. If a project is cancelled the client may get at least a significant portion back but you get paid for all the work you did.
The way that this works is that the customer pays you money, which you hold in trust for the customer (i.e, you owe it back, or the work). Then as you work you bill the customer, and effectively pay that bill out of the money you are holding on the customer's behalf.
Option 2: Fixed bid, with periodic adjustments, and payment by milestone
In this way you do work up front and bill in arrears. However, your bills do not wait until the end of the project, and if you are not paid, you can leave the project half-done. Since customers typically do want their projects finished this works out well. Typically the way I have done this is:
If there is no change likely to scope, fixed bid per milestone, payment due on milestone completion.
If there is change likely to scope, fixed bid on first milestone (with adjustments possible by mutual consent) and estimates on further milestones. After each milestone, we discuss, and agree on a bid for the next one.
This approach basically breaks the project down into smaller subprojects which are independently billed. The risk profiles are different so it is worth discussing both options with mentors and accountants if you are unsure, or just trying both out and seeing which one you work best with (I much prefer the milestone approach for my business, but I recognize the strength of the retainer approach too).
These options work out quite differently accounting-wise. If you work on retainer, it is worth discussing how to keep your books with an accountant, particularly if you want to keep your books on an accrual basis. Milestones are a lot simpler. Retainers involve a lot more backend accounting work. I do work on both bases depending on what customers require and based on my past experience with a customer.