Opal card (or credit card tapping) works on all modes of public transport. Trains (they do go under ground in the inner city areas), tram ( like a street-car), buses and ferries. It's pretty much all integrated.
You MUST tap on when you get on and AGAIN when you get OFF! Otherwise you get charged a penalty rate. Tapping facilities for buses are inside the bus, by the doors. Tapping for trains, trams and ferries happens at turnstiles or terminal before you get on/after you get off. (Just see what others do).
When you are switching between two or more modes of transport ( say, from a bus to a train) you get charged a "transfer" rate, not two separate, full price fares. The allowed transfer time is quite generous. Quote from the Transport NSW website:
"Transfers happen when you switch transport modes or routes, and if they're within 60 minutes, they count as one journey, except for the Sydney Ferries Manly ferry service, which has a 130-minute transfer time."