Fundamentally, we can find by performing absorption spectroscopy of the material. A direct bandgap material will absorb the light of wavelength equal to its band-gap whereas an in-direct bandgap material will not. On the other hand,
Theoretically the energy gap can be determined by a first-principles calculation within the Density Functional Theory (DFT).
Experimentally you can check with Photoluminescence signal. Indirect bandgap semiconductors don't give PL signal while direct ones give strong PL signal.