Yay to you for thinking about this and asking this question. It’s absolutely true that most bad managers have no idea that they’re terrible at managing, or at least have no idea what their staff really thinks of them. And very few of them undertake any kind of sincere effort to find out.
One important thing you can do is to be very deliberate about creating an environment where it’s safe for people to give you honest feedback. That takes time, because the power dynamics inherent in your relationship with your team mean that most people will err on the side of, at the least, shading the truth about how they feel about your management. To build a team that feels comfortable giving you honest feedback will take time — but you can do it by things like not reacting defensively when someone disagrees with you, being actively appreciative when people give you feedback or a differing point of view, and some of the other suggestions here.
But being a good manager isn’t just about your team liking you/being happy with you. The most important indicator of how well you’re managing is what kind of results you’re getting in your realm in the long-term. So that means you should ask yourself questions like:Read the full question and answer @ Ask a Manager