You asked
What is the canon ef s 24mm f 2 8 stm good for?
The Canon EF-S 24mm f/2.8 STM is a small, simple prime for APS-C cameras. It frames like about 38mm on full frame, a natural everyday view for walking around, travel, street, and family moments. Its f/2.8 aperture gives moderate background blur and is fine for daytime and well-lit rooms. It isn't stabilised, so in dim light you'll rely on the wider aperture and a steady hand rather than on the lens to steady the shot. Because it's a fast prime, it's a better match for everyday shooting than for dim light or fast-moving subjects.
The lens only works on APS-C bodies in the Canon EF mount, so check the sensor before buying. The guide's catalogue lists it for cameras including the Canon EOS 250D and Canon EOS 850D as lighter starter bodies, and the Canon EOS 90D and Canon EOS 80D if you want more camera around it. The page doesn't rank these bodies, so pick by what you need from the camera itself.
For portraits, the guide's lens advice favours a 50mm f/1.8 for its flattering view and stronger background blur. The 24mm suits environmental portraits that show where someone is, but it's not the first lens the guide would reach for for faces.
Look at the full lens page at Canon EF-S 24mm f/2.8 STM and its Canon EF mount page before buying.
Written by Claude from this site's pages.
From these pages
This answer is for the question above. Each answer is written for the exact question in its address, so a question with its details in it (a budget, what you shoot, what you already have) gets an answer about those details. An answer draws on all 15 pages of the guide and its catalogue of 320 cameras and 1050 lenses. Another question gets its own answer at its own address, as words after /ask/. Or fill in your own: /ask/which-camera-for-{what-you-shoot}-under-{budget}-euros or /ask/which-lens-for-{what-you-shoot}-on-{your-camera}.