You don'tcan't.
I have 20 years of working experience as a software developer and I've never worked in a team that "got it right"…
I'm sick to death to waste time in planning sessions trying to fit squares into circles just because everything has to be broken down into tasks that anybody, regardless of their experience or skills, can achieve in a day.
And all that for what? So we can have nice-looking burndown charts?
Inevitably even the most dedicated developer will start gaming the system just to end the pain.
Managers would rather trust a pseudo-science with zero evidences to show for it than the developers who actually produce the software.
Try ownership and accountability instead.
Depending on the size and seniority of the team, you may need to steer the boat in the right direction once in a while but generally speaking, when people feel empowered and trusted you enable them. That's leadership. It's hard but much more effective than Scrum or Agile.
My hope is that one day my daughter, if she chooses to be a software developer, won't have to put up with this non-sense.
I sometimes feel like we all felt for a scam and are too ashamed to admit it.