The San Diego light rail system has a station across the street from the CBP entry point. It's a straight shot from north and downtown.
The run is fast, it is on dedicated railroad right-of-way once it gets out of downtown. It's about a 45 minute run from the Santa Fe depot (the hub) to the border (San Ysidro).
Check their website but most stations, especially suburban ones, have parking.
src. Orange line now goes to Arnele Ave.
Arrive a few minutes early to the station, and find a ticket vending machine at the station. It will sell you a ticket valid from "now" until a few hours from now. Don't board without it; you cannot buy a ticket on the train.
The system uses a modified honor system, called "Proof of Payment", where a fare inspector might check everyone for a valid ticket. Not having one is a civil infraction like a speeding ticket. This can also be done on a smart phone via an "app" but I advise doing it before boarding, because they have safeguards to prevent people from buying tickets only when they see a fare inspector coming...
Despite being called a "trolley", it's actually an interurban using an old railroad line - the San Diego & Arizona Eastern, in fact - known for the world's largest trestle at Carrizo Gorge.
Obviously you have to evaluate public transit vs the still-lingering COVID-19 risks. Masks are still required on public transit because immunocompromised people have to ride it too.