The most commonly known advice is to breath in as you lower the weight, and breath out as you move the weight against gravity. In my opinion this is not the best advice. You’ve probably noticed that, when you’re getting near muscular failure and/or dealing with some heavy weights, you tend to hold your breath in certain parts of the movement. This is called the Valsalva maneuver (VM) and we all do it unconsciously and in the hardest part of the movement (the sticking point).
The VM consists of a forced exhalation against a closed glottis (no air comes out), just like you do when you’re sitting on the throne. It increases intra-abdominal pressure, which increases stability at the spine, preventing injuries, mainly in the lower back region , so it’s especially important when you do exercises with axial loading , like squats, deadlifts and their variations. However, it's not all unicorns and rainbows. Every time we do a VM, there’s a rise in blood pressure, and if you hold it for a prolonged period of time, you can get dizzy and even faint (among other things). In my personal experience, light to moderate dizziness after a hard set sometimes happens, but I think there’s quite a big distance between getting dizzy and fainting. The fact that these episodes can happen raised some safety questions regarding the use of the VM during exercise. So, what should you do? For most isolation and some compound exercises, just breath normally, doing the VM when your body "asks" you to. However, when you’re doing heavy compound movements where you have to keep your spine in a fixed position (squats, deadlifts and their variations, barbell rows, etc.), my advice is to use the VM at least through the sticking point, but avoid doing it for more than 3 consecutive seconds . For example, when doing bicep curls, I tend to breathe normally, but once I'm getting close to failure, my body starts to "ask" for a VM in the sticking point of the movement, so I just do it. However, for the leg press for example, I do the VM since rep 1, because it's a compound movement, with a considerable amount of weight and where you should keep your spine in a neutral position. What I normally do is: I inhale on the first half of the descent, I’ll do the VM during the second half of the descent and the first half of the ascent (where the sticking point is), and then I breath out. Sometimes, in the last reps, I'll even do the VM from the beginning of each rep. You don’t have to do it like this. These are just a couple of examples of how I approach breathing in specific exercises. Now, if you have any heart/cardiovascular disease, be extra careful with the VM. There’s not enough data to know if there’s an increased risk or not in these populations. Probably, there's not a big risk. The study by Hackett et al.  showed that a VM done while exercising resulted in a lower raise in blood pressure compared to doing the VM by itself, but we still need more information on these specific populations.
References:  Hackett, DA and Chow, C-M. The Valsalva maneuver: its effect on Intra-abdominal Pressure and safety issues during resistance exercise. J Strength Cond Res 2013 Aug;27(8): 2338–2345. doi: 10.1519/JSC.0b013e31827de07d