In general, on the road, the faster you go, the safer you are. On the footpath, the slower you go, the safer you are. So the decision will usually come down to how fast you want to ride.
Riding on the road with cars can be nerve-wracking at first, but as experience grows, and people remarkably don't run you over, your confidence and comfort will increase.