Like if I used phong glsl type of shading does that automatically use the bdrf rendering?
The method of rendering and a BRDF selection are two separate topics. All of them can use the same BRDF. To make it super simple BRDF is the equation that you have in your vertex/pixel shader for calculating a color. The rendering method is about how you get to invoke those shaders.
The first method is slow for certain scenarios, like tons of lights but is superb for others. Modern game engines usually have a mix of 2 or all 3 of these methods for different types of objects. For example you could have deferred lighting as a base method for most solid objects, forward pass for translucent stuff like glass and raytracing for global illumination (indirect lighting). Up to about a decade ago pretty much all popular engines used mostly forward renderers but nowadays everything is a hybrid of multiple techniques.
But all that can be a bit overwhelming, so don't try to jump on all of these at once. Pick one and implement that for a start.
how do I select which rendering style?
It's like choosing bubble sort or quick sort. They are just different algorithms suitable for different tasks, so you just pick one that is best for your situation. You can use both if you want.
Forward renderer is the easier one. For each light you set its properties as shader constants and just draw each object with a shader that implements e.g. Phong's equation using these constants. You draw that directly to the framebuffer (assuming you don't want to do any postprocessing later like blur, bloom, chromatic aberration etc.).
Deferred approach is a two-pass algorithm on the other hand. In the first pass you set up a framebuffer with multiple attachments, one texture for each element of a g-buffer. You render each object and a shader writes to these buffers information about the objects' materials - normals, color, roughness etc. In the second pass you take these textures and set them up as multitexture input, bind another buffer containing light information like positions, color, falloff etc. and then do a draw call with that. In that pass you use the same BRDF as in the forward rendering but he difference is that object information is encoded in the g-buffer textures and not as vertex attributes of individual draws. The second pass goes to the single output framebuffer (again assuming no postprocess passes).
Here's a tutorial on that technique: Deferred Shading.
Shadows are yet another topic and I wouldn't try to do them until you have a grasp of basic lighting. In forward and deferred rendering they are an effect separate from lighting. Yes, I know, it sounds weird, but shadows are not part of lighting in those techniques. They are calculated as an entirely separate pass using techniques like shadow mapping, cascading maps, PCF, VSM, PCSS or others. For example some good explanation of VSM technique is shown in one of the GPU Gems books I mentioned: Summed-Area Variance Shadow Maps. But again - I wouldn't worry about shadows just yet. Do basic direct lighting first and get comfortable with it before you move on.
In raytracing shadows show up kinda naturally and automatically, because this technique is the closest to what real light does. Shadows are just places where the rays can't reach. Raytracing is a bit more advanced technique and I wouldn't start with it though, especially since it is now hardware accelerated on many GPUs, but OpenGL has no direct API support for it, so Vulcan or DirectX12 are better suited for that task..