You first think about how much a project will cost in the initiation stage.
At project initiation, cost management and project financials are really about understanding. Understanding what you are doing and why, and how much you get out and how much you need to put in.
Firstly, consider whether it aligns to the organisation’s financial strategy, and whether it will create a suitable return. You’ll also want to work out how long it will take to get this return, or work with your financial management team to do so.
The project charter should include a description of the financial success of the project and how it will be measured.
You’ll use these as the success criteria for how the project will be judged on financial performance at the end.
You might be able to add costs to any risks mentioned at this point in the project charter.
The tips here are all discussed in more detail in this book Project Management Accounting. It’s a great primer on the financials relating to projects and it goes into a lot of detail so it’s handy for beginners and those with more experience.