To run GarageBand on El Capitan, you typically need (specifically 10.1.2) or the older GarageBand '11 (version 6.0.5) .
If it's not in your purchase history, you can sign in to your Apple ID on a friend's newer Mac (running a recent OS like Ventura or Sonoma), "buy" the free GarageBand app there, and then return to your El Capitan Mac. It will then appear in your Purchases tab as described above. Updating Extra Content (Loops & Sounds)
tab at the top of the window (or click your name/profile icon in the lower-left on newer App Store layouts). Find GarageBand : Locate it in your list and click the Confirm Legacy Download