I have a bad habit of trying to deal with this by estimating how much code I can write in a day and seeing how that compounds over time. That way when you see that you can have "x lines of code" written by the end of 2/3 months, it makes you feel okay this much amount of code is enough to finish up the project.
Not sure if this is the ideal way to go about things.