That leads into riding defensively. I ride with the mindset that everyone is trying to kill both me and themselves. I expect people to pull out in front of me, I expect doors to open etc.
To get a bit more used to being around cars I would recommend getting up early.
But really the main thing is confidence. You have just as much a right to be there as anyone else, and in reality the vast majority of drivers are great. I very rarely have bad experiences with cars. Obviously it takes time to build up confidence, but at the end of the day a confident, assertive rider who signals and manoeuvres well ahead of time is going to be safer than a nervous, skittish rider.
The relative speed between vehicles it's what does matter - keep the flow (or between the waves), the distance and attention (doors, sideways, blind spots, bus stops), be obvious predictable, use your imagination (fly trajectory) and signaling - even take a middle of the road when needed to not confuse someone he can take a chance to overtake you at wrong moment.