The research I have seen suggests
sidewalk riding is more dangerous than road biking, especially at intersections. So as a general rule, I ride on streets and take the lane if needed. For one of my rides, I add about a 1/3 to 1/2 mile on street to avoid a sidewalk bike route since it is lined with retail stores with cars coming and going from all directions.
But when I do use a sidewalk, I try to bike with traffic so I will likely be more visible to a right turning motorist. I still need to be careful with the motorists from other directions that I assume do not see or expect me. This was a suggestion from Cycle Savvy