The Lothian Buses No. 37 bus service runs every half hour Mon-Fri and every 20 mins Sat and Sun from Roslin village into Edinburgh. There is also a night service which comes directly into the village from Edinburgh.
http://lothianbuses.com/getting-around/journey-planner