I kind of do though still learning to get better at it.

The dev process at our company is mixture of Agile and Waterfall. Management wants to know when a large project with several unknowns will be done. There is no way to give a realistic estimate. The management says that it is just an estimate and they won't hold it against us. And we can revise it as we learn more.

In past, I gave rough estimate with some padding but that bit us, because, actual work was more than my rough estimate. And my manager completely forgot that it was supposed to be rough estimate. Product owner started whining about all the marketing they had done, some higher ups got involved. We start having daily meetings to discuss exactly what we did yesterday in addition to daily standup. Some late nights and weekend work. Overall, horrible experience.

Then I decided I will not give estimates no matter what. My manager scheduled a meeting with me and a her director. Where they kind of used police interrogation tactics, asking same thing again and again. They were supposed to help me break down overall project in smaller pieces and then estimate each piece. BTW, I am tech lead but not project manager. I tried my best but broke down and worked with them to come up with an estimate with a lot of padding. That was not good, so in further meetings they cut out some features and asked me to lower the estimate. They repeated same thing that it was just a rough estimate, we would not be held to it. Of course, when deadline got closer, they started to panic and told me that I chose this deadline and our team needed to meet it.

This just pushed me to not give a fuck. I started interviewing and got a few job offers. These offers were not great but I still was willing to move. I told my manager that I
was failing in lead position, so I need to resign and go back to dev. She told me that after this project, I can go back. But when she found out that I already had a job offer with more money as a dev. Management panicked and they countered and extended deadline.

I took the counter offer because I was not excited about other company but they liked me enough and said I have a standing job offer any time.

After going through that I learned a few things about managing upwards.

1. Be willing to walk away.
2. Raise dev issues as early as possible. If you had estimate that something will take 2 days but it took 3 days, bring it up in scrum. Make a big deal. Tell management that this probably will impact deadline. Same if you get sick.
3. When they ask you to estimate unknown work, ask the about unknown work. They will connect with you might five you some insight but usually not. Just repeat to manager that was not useful.
4. Always talk about how good industry and how you are networking all the time. This sends the message that you can walk away at if they try to push you.
5. Never ever work more than 40 hours a week. Even if you are bored at home and want to work, do your own project. Once you agree to work one of your weekend, management will consider you pushover and you will work a lot of weekends. At my large company, my team and I have not worked weekend for almost 2 years. But it is very common for other teams to work a few weekend every quarter.