Color-Coding Ways Based on Tags

How can I color-code ways based on tags, e.g. number of lanes, surface-type. Is this something that can be done directly in OSM or would I need to use the Overpass API to get this data and then another API like OpenLayers to create the desired layers?

Best way is to use overpass-turbo and style the data using MapCSS, see