Development of laser-based techniques to cool and manipulate trapped atoms led to a quantum revolution, with applications ranging from creation of novel phases of matter to realization of new tools for navigation and timekeeping. Because of their comparatively richer internal structure, molecules offer additional potential for quantum-controlled chemistry, quantum information processing, and precision spectroscopy. However, obtaining control over the rotational quantum state of trapped molecules, a prerequisite for most applications, has presented a significant challenge because of the large number of initial states typically populated and because of unwanted excitations generally occurring during optical manipulation. Using a single spectrally filtered broadband laser simultaneously addressing many rotational levels, we have optically cooled trapped AlH+ molecules from room temperature to 4 Kelvins, corresponding to an increase in ground rotational-vibrational state population from 3% to 95%. We anticipate that the cooling timescale can be reduced from 100 milliseconds to a few microseconds and that the cooling efficiency can also be improved. Our broadband cooling technique should also be applicable to a number of other neutral and charged diatomic species. Trapped AlH+, in particular, is a good candidate for future work on ultracold chemistry, coherent control and entanglement of rotational quantum states, non-destructive single-molecule state readout by fluorescence, and searches for time-variations of the electron-proton mass ratio.