This post will focus more on Autoflowers than Photoperiods since they are mainly what I have experience on and Photoperiods are more forgiving so they are more open to defoliation throughout.
So the whole point of defoliating is to open up the plants to allow more light and airflow. We will start with the light, by allowing the light to penetrate deeper you will have bigger buds. What typically happens without defoliation is the buds on the lower parts of the plant will not develop very much. I personally have seen the difference a bud that would have been blocked by a leaf vs one that is allowed to soak the light in and it is major. You strategically do this in a few spots and the difference could be 50% more yield and more quality on top of that.
The other reason is for airflow. Opening it up allows it to breathe more and it can also fight against pest. Most flying pest that attack our cannabis plants do not like direct air from the fan beating on them. This can be a great way to try and prevent pest. What we are trying to achieve with indoor grows is to mimic the environments of outside. Outside you will have light that naturally penetrates all angles of the plant as the sunlight will vary throughout the day unlike our tents where the light is stationary in one spot. Same with the airflow, it will change directions and can hit from all angles. This is why we need to defoliate when we are growing indoors.
There is typically 2 times that most people agree on as far as when to defoliate and how. 21 days into flowering and then again at 42 days. You want to make sure to not remove too much at one time. (there are different more advanced defoliation methods I will not cover here but as you continue to grow feel free to branch out) Typically most people will say to not remove more than 20% of leaves at one time. With autoflowers you risk the chance of stunting them and they do not have the time to recover like photoperiods do.
For me personally at day 21 of flower I will pull my plant out and make sure I have a light on above the canopy. I will get under the plant as much as possible and see which leaves are blocking the light from coming through to the bottom leaves. Start by snipping those few to where you can open up the canopy up and allow that light through. Make sure to use sharp clean trimmers (clean with alcohol after you use each time). The next trim I do at 42 days into flower I will snip the bottom leaves off and any small bud sites that look like they are not going to amount to much. The thought process behind this is that by removing those leaves and bud sites at the bottom the plant will focus more energy into the bigger sites and not wasting precious time and resources on buds that will not be much. This will make more sense as you grow and start to see this unfold.
So remember, you want light penetration and good airflow. Do not remove more than 20% of leaves at one time. Trim at 21 days and 42 days into flowering. Take the leaves off the top that are blocking light and then remove the smaller bud sites and leaves near the bottom of the plants (typically the bottom 1/3 of the plant people remove).
Picture below shows the before defoliation (this was already after the first one at 21 days into flower)
I removed the leaves that had deficiencies on them since they can attract pest.
The after defoliation. Try to not go too crazy on removing leaves, they are the solar panels and store the nutrients. Like I said there are other more extreme methods but this is just the basics.