Can't understand the Importance sampling GGX I've read many articles relating to importance sampling of GGX. However, I still feel confused.

The formula of GGX is :



And many article says we should use this formula to sample:



In the formula, theta is the angle between the normal and the halfvector. So what the formula shows is how to sample a angle between normal and halfvector? But, in the article https://schuttejoe.github.io/post/ggximportancesamplingpart1/
it says "To importance sample D(ω^m) we will use the inverse of the CDF of D(ω^m) to generate a microfacet normal ω^m. If you are familar with using GGX in game rendering this can be thought of as creating a half vector in tangent space." How is theta related to microfacet normal? How can I sample a Li based on the theta?
In microfacet BRDFs, the half-vector is the same as the microfacet normal. The half-vector is exactly the required normal for a microfacet to reflect light from the incident ray to the outgoing ray, by the law of reflection. So, for given incident and outgoing directions, only those microfacets whose normals are aligned with the half-vector are "active".

Conversely, when importance-sampling a microfacet distribution, we wish to select a random microfacet normal, then reflect the incident ray through this normal to produce the outgoing ray. The incident and outgoing rays will then have the chosen microfacet normal as their half-vector.

For an isotropic BRDF, you will sample theta from the inverse CDF, and you must also sample phi, the azimuth angle about the normal, uniformly between 0 and 2π; then convert those into a unit vector using the usual spherical coordinates (as mentioned in the linked blog post), combined with a tangent-to-world transformation. For an anisotropic BRDF, both theta and phi would be supplied by sampling an inverse CDF.