Around my place it’s illegal to ride a bike on the sidewalk unless you are on a very small one made for a child. Still happens a lot but I don’t blame the cyclists since there seems to be zero enforcement.
Only an asshole of a cop would ticket a cyclist for riding on a sidewalk.
If you have to ride on a street, I’d ride against the direction of traffic. If it is safer to walk on the side opposite the flow of traffic, it’s safer to ride on that side for the same reason.
Having a freaking huge flashing red and blue light might also help.
Best decision is to ride on a dedicated bike path