I use the lock recommended by the Lockpicking Lawyer [1]. You can buy them at Tip Top Bike Shop in Temescal (no affiliation but support your local bike shop!).
The guys at that bike shop said that for example if I want to ride to Lake Merritt and walk around for a while, I could lock it near the boat house and leave it for a couple hours as long as it’s daytime. They said don’t leave it overnight which I would never do. If I’m going to the grocery store, there’s so many people coming in and out, it’s just not the kind of environment where a bike thief is super likely to come in with an angle grinder and start attacking my chain lock. It’s interesting because we imagine this place to be high theft and I guess on some level it is, but having a lot of people around does feel like a decent deterrent, along with a good lock. I’m more worried about my panniers, which aren’t locked to my bike and lift right off with no tools. I wouldn’t use those if I was leaving my bike for a while, but again at the grocery store people are coming and going so often it would be pretty risky for a thief to come and mess with bikes.
Or if I'm going to a coffee shop, I'm always within 20 feet of it and I can see it, and it’s locked. That’s fine. If I’m riding to a friends house, I leave the bike inside their house when we go do stuff. At the bike shop, I just bring the bike inside the shop with me.
It wouldn’t be a bad idea to start with a cheap bike, and use the cheaper BBS02 motor and a cheaper battery. Then if it gets stolen, as much as that sucks, it’s easier to recover. Though cheap batteries present a fire risk. A lot of people on Reddit stand by the the UPP batteries, but Louis Rossmann had his catch fire so opted for the EM3EV battery at twice the price. I also got a big battery which isn’t strictly necessary, though it’s nice.
[1] https://youtu.be/SpVOTEOMRuE