The National Botanic Gardens lie just 3.5 kilometers north of Dublin city centre. there are three bus services that will get you to the Gardens, information for these, and driving routes are shown below.
For any other starting points in Dublin, use
Hittheroad.ie which is an excellent website showing you how to get between any two points in Dublin City,
using a smart combination of Dublin Bus, Luas and DART routes.