I found the agile practice of estimating a task's complexity along a Fibonacci scale (1, 2, 3, 5, 8, 13) and then multiplying it by a conversion factor based on my proficiency (or familiarity with the code base) has worked best for me—since clients aren’t typically familiar with agile methodologies!
For example, let’s say I’m working on an app and estimate task A as having a complexity of 5. Because I was the primary author of the app, I use a conversion factor of 2 hours/complexity unit, yielding a time estimate of 10 hours.
The idea here is to leverage the fact that engineers have a better grasp of complexity, while business stakeholders can only appreciate time.
Keep track of your estimates over time and you can adjust the conversion factor accordingly (higher, lower, or even using days instead of hours) for more accurate predictions going forward.