Take the DART (Dublin Area Rapid Transit) to Malahide Station. The castle is a short walk from the station.