Well, I usually start off playing aggressive and it usually works for a few games but then gradually I resort to defensive play and stay there till the end, but it's mostly because of fitness and also me just being a naturally defensive player... I really need to work on my upper body strength cause I get tired of hitting the ball hard far too easily compared to my legs which can run for hours.
So yeah, unless it's a fitness issue, which makes you rush your shots or stop going for them, then I would suggest just trying to keep reminding yourself to find the balance. Once I realize I'm too defensive, I kinda force myself to go for more with my stronger shot (backhand), while still keeping my weaker forehand safe because I've never actually been consistently aggressive with my forehand in tight situations and I can't afford to make cheap mistakes at that point.
Also, don't blame yourself all the time for this. There's bound to be certain types of players who will either force you to be on the defense all the time or make you go for your shots by their endless pushing. The last match I played, I lost against a clay court specialist who did nothing but push and run. With me being a cow on ice on clay, I really had no other option but to go for broke, which ofc didn't work.