Handlebars mostly fall into two categories: drop bars and upright. Drop bars are fitted to bikes intended to go fast and/or for long distances. They allow for multiple hand-positions and an aerodynamic riding stance. Other than road bikes most mountain, urban, comfort bikes, etc. are equipped with upright bars. They allow for a more erect posture.
Not sure what handlebar you need? Make sure you know your clamp diameter. This is the diameter of the handlebar in its middle where the bars attach to the stem. Common sizes for modern bikes is 31.8mm & 25.4mm. Grip size area is also important to consider. For example drop handlebars use a different size brake clamp than upright handlebars.