Look on the wheel well on the other side of the car and we how that piece of trim is attached to that wheel well.
Chances there’s a groove it has to get seated back into. Try to reseat the trim.
If the trim got damaged somehow and wont reseat, take it to a parts store and they will sell you a replacement.
