...how often you screw up in your relationships with your children - what matters is how often you make an effort to repair the mistakes you make. For some reason, I recall them saying something along the lines of - as a parent you can get it wrong 40% of the time - but as long as you make sure to get it right the other 60%, your relationship with your kid will be good. Obviously you can't ignore the relationship and you have to repair things when you make mistakes by apologizing, etc.
There's a program called Circle of Security that talks about developing secure attachment with your children. A lot of their stuff is focused on younger children, but they have some stuff on teens too. I like that the concepts include recognizing the loss of emotional regulation, working to de-escalate, and then helping the kid name what they're feeling and connecting with them. Here's a short blog post with some of their info as it relates to working with teens.