This question gave me a flashback to my shop days when a customer came in complaining about the high-pitched squealing when using the brakes and wondering if applying lube on the rotors would prevent the embarrassing noise.
Lube the brakes, no, but address the cause, yes.
There are two major causes for loud brakes—contaminated pads and misalignment. First and foremost, ensure the rotor is not warped or bent; otherwise, getting things aligned would make it nearly impossible. Next, check that there is even alignment between the pads and rotor on both sides. Ensure the pistons and pads are moving equally on both sides when the lever is actuated. If only one side is moving or one side is touching the rotor significantly earlier than the other, then adjust the caliper placement. Sometimes a piston on the caliper can get sticky and have limited or no movement. This needs to be addressed before you continue.
If all of those things seem to be in order and the noise started out of nowhere, then it’s probably contaminated pads. It could be from something like a puddle that has oil or brake fluid mixed in that splashed onto the pads. In this case, I would remove the pads, and after placing some fine sandpaper on a flat surface, scuff the pad along the paper trying to keep them flat as to not modify the contour of the braking material. All you are doing is trying to remove a very small amount of surface material that might have a foreign substance on it.
Many times the pads can soak up foreign substances, which makes it nearly impossible to save the pad. Also, use a bit of isopropyl alcohol on the rotor to ensure they are clean.
If none of these methods work, then brake pads could be unevenly worn, and even after aligning everything will still cause vibrations and resulting noise. There are other causes, but in my experience, they’re much less common and would require specialty tools (a disc brake facing tool) that only a bike shop would have or need.
Remember that while disc brakes are still fairly new to the road market, they have been the only option on mountain bikes for over 20 years. Your local shop will have a vast knowledge of tricks and the experience to get your brakes quieted down.