Horarios do Funchal run the yellow city buses you see all the time. They work on an Oyster Card like system called Giro, wherebye all the city routes are a set fair, and the price you pay is €1.95 on the bus but you can save money by getting a reusable ticket and topping it up, with journeys being €1.35 each unless you add on 10 or more in which case it is €1.25 per journey. Second journeys within an hour dont cost, so whether you take a bus to Funchal and then one to Palheiro, or you bus it to H&M, run in to grab that shirt you saw yesterday and then quickly return, it should only cost one fare. The present Giro system will stop working 30 November and any remaining tickets will be lost, but there should be a new system to replace it.
The main buses to town are 1 and 2, and between them you will rarely wait more than 20 mins, and they run until well after midnight.
You can buy and top the tickets up in various places, from newsagents in the Forum, and Monumental, to pay kiosks at the marina and by the cable care.
Horarios do Funchal also do inter-urban sevices to places mainly north east, so Santana for example.
They have an excellent website, in English, easy to use timetables, and adapted for mobile phones which you can click on here.