Several aspects to this in my experience, which is heavily influenced by early buddhist teachings.
Firstly, make a habit of seeing the full picture of something you’re evaluating or judging. This might be the ‘other side’ of the story (someone else’s perspective), the benefits of something you’re criticising that you’re otherwise missing, or an understanding of the worth of something you might be defending.
Secondly is to recognise the benefit of positive thoughts (like goodwill towards others) on yourself and the people around you. You may like to add some intentional practices here such as what’s referred to in Buddhism as loving kindness (‘metta’) meditation or performing generous acts. The uplifting in mind state you get here will incline you away from a lot of criticising and judging.
Principally though the goal would be to get to a point where a build up of negativity is not occurring for you and there’s no need to vent, but getting there is practice. It is great that you are reflecting on this and looking for another way so best of luck to you!