The fear is natural and will decrease with time if you keep riding, but there are ways to speed up the process. This is basically just a list of the various things that helped me become confident with riding in traffic. Some of the advice is specifically about building confidence, but a lot of it is just good advice for riding with traffic safely. The best way to build confidence is to know for a fact that your confidence is justified.
Generally, the faster you can go (while still maintaining control), the easier it is to ride with traffic. The closer you are to the speed of traffic, the more time you have to react if you need to, and the more time they have to see you. To take somewhat extreme examples, if they're traveling at 90 kph and you're going 15, you're basically a stationary object to them. But if they're traveling 40 kph and you're traveling 30, they close the distance at the same rate they would if they were just jogging, and will have plenty of time to react.
I can't speak for everyone, but in my case, there's also a psychological benefit. If I'm going at least half the speed limit, I tend to feel like I belong on the road. But if I'm tired or going up a long hill, and start to drop below 15 kph, I get nervous that the drivers will start to see me less as a slow vehicle and more as an annoying obstacle. (To be fair, as far as I know, this is mostly just in my head, but since the question is about confidence...)
In general, I tend to be comfortable on roads where the cars are going at or below 55 kph as long as I can stay between 25 and 30 kph. If I'm going 20 kph, I'll feel comfortable on 45 kph roads. (I can safely ride with faster traffic; those are just the relative speeds where I feel most comfortable.)
Favor slower roads if you can while you work on building your speed (either through increased cadence or by gradually increasing the gear while keeping the same cadence). Your speed will increase naturally as long as you keep riding regularly.
Counterintuitive though it is, riding on the very edge of the road actually gives you less space. If cars have enough room to pass you without changing lanes, they will, even if they need to pass within 20cm of you to do it.
Instead, you should ride about 1m from the side of the road. This forces cars to actually move into the other lane in order to pass you at all, and once they need to take the time to do that, they'll usually pass at a safe distance. And if they get too close anyway, you're not on the edge of the road already, so you can move there to escape the danger. Just knowing you have that option can improve confidence.
If the road has multiple lanes going in each direction, it's even easier for traffic to pass at a safe distance; if you need to ride on a fast road, multi-lane roads are a bit safer than they would be otherwise.
It probably goes without saying, but the better you can see, the less you need to worry about what might cause trouble. If you can, avoid riding in the rain until you're more comfortable; the combination of decreased traction and decreased visibility makes things everything else harder to deal with.
Night riding is probably fine, but your confidence will be much higher (justifiably) if you get a good headlight.
A lot of bike lights are just meant to make you visible to cars, rather than give you a clear view of the road. That's fine for tail-lights, but for the headlight, you want something better if you can afford it. I cannot overstate how much difference a good light can make for confident night riding.
This site has side-by-side photos of various lights in action. They range from "I've seen brighter candles" to "I thought the sun was out, but it turns out I just left my headlight on", with prices to match. (I use the Light and Motion Urban 350, which falls somewhere in the middle). Your local bike shop could probably also make suggestions.
You should follow the traffic laws as though you were a car, even ones you aren't bound by. The reason for this is because drivers are all subconsciously expecting other vehicles to do so. You want to be predictable, because if you're not, drivers will have to leave their normal pattern of behavior to avoid you, which means that they're not predictable, so you don't know how to respond to what they do, and suddenly everybody is improvising instead of relying on experience. But if you're behaving predictably, then they'll be predictable, and everyone on the road knows what everyone else is doing and can proceed with confidence.