Brentwood is about 50 miles east of San Francisco, roughly an hour's drive without traffic. Take Highway 4 east from the Bay Area — the town is at the eastern end of the corridor, beyond Antioch. There is no practical public transit from the Bay Area to Brentwood; a car is essentially required, especially for the farm trail, which is spread across rural roads.
From Sacramento, the drive is about 45 minutes via Highway 4 or I-5 south.