Malahide is accessible both by bus and rail. Malahide train station is in the town itself. See the Irish Rail website Irish Rail for train times. Malahide train station is on both the DART line and the Suburban commuter lines. The train station is located in the center of town.
There are many bus services that reach Malahide, see the Dublin Bus Website Dublin Bus look for the 42 timetable. The bus runs frequently on every day of the week.
The main bus route from Dublin city centre is the 42 bus which leaves from Abbey Street. The bus stop is near to the Luas tram stop and the Abbey Theatre
The 42 destination will show either Portmarnock via Seamount or Malahide via Seabury, both pass through the centre of Malahide town.
Ask the bus driver for Malahide -- will take about 40 minutes in total. The main bus stop in Malahide is next to the train station, the main bus stop is over the humpback bridge, the train station is on your left-hand side. The bus will stop is outside the church. The return stop is on the other side of the road.
The 32A also runs between Dublin city centre and Malahide. It takes a different route and also has a different start and end point. It runs less frequently than that 42.
Please note that the 42 is very different from the 42A and B.