Most freelancers, and even businesses, charge by the hour.
Your client is not buying your time. He is buying your project, your services to do something. Charge by your project.
Of course you need to plot your (and other resources’ ) times to do the project. But don’t outright tell them that you need 40+ hours to do a project. Instead, just tell them that you’ll charge this much for implementation, plus all other project costs e.g. technology, transportation, planning, ect.
Of course, there are exceptions when to charge your time – when your client is really buying your time…
… time to do out-of-scope work.
… time if he wants to finish the project earlier.
… time delayed because we wasn’t able to meet his scheduled deliverables or deadlines.
Your time, as a business owner and entrepreneur, is the most important thing that you have. For your client, he doesn’t care about your time. He cares about getting what he wants done.