Yes. Selena Gomez has writing credits on many of her songs, often co-writing with professional songwriters.
She typically collaborates with hitmakers (Julia Michaels, Justin Tranter, Ross Golan, etc.) and contributes personal experiences, melodies, and lyrical ideas. She has also written for other artists.
While not a sole writer on most tracks, her creative input is significant and documented in credits (ASCAP, BMI, liner notes).