The best way to reach the Sagrada Familia is to take the metro. The metro station right across the street from the Basilica has stops for Line 2 (purple) and Line 5 (blue) metro lines.
You can also take bus, and depending on your place of stay, catch any of the following buses all of which halt at Sagrada Familia- 19, 33, 34, 43, 44, 50, 51, B20 and B24.
Carrer de Mallorca, 401, 08013 Barcelona, Spain - Get Directions
The opening and closing timings of the Basilica differ throughout the year, and you should check for it in advance.
November to February | 9:00 AM - 6:00 PM
March | 9:00 AM - 7:00 PM
April to September | 9:00 AM - 8:00 PM
October | 9:00 AM - 7:00 PM
December 25, 26 and January 1, 6 | 9:00 AM - 2:00 PM | 9:00 AM - 6:00 PM
The management can sometimes alter these timings if any special event is to take place inside the Basilica La Sagrada Familia.