Alt text is a short written description attached to every image on a website. A blind visitor using a screen reader hears it instead of seeing the photo. Anyone on a bad signal sees it in place of an image that has not loaded. Search engines read it to work out what the picture shows.
How to write it
Describe what is in the picture, plainly, as if you were telling someone on the phone. New grey concrete tiles on a semi detached roof in Wakefield, scaffold still up. That is alt text. Roofing services Wakefield roofer roof repair is not, it is keyword stuffing, and it reads as nonsense to the one person who most needs the description.
Keep it to a line. If the image carries information that nothing else on the page carries, such as a price list in a picture, put that information in real text instead.
When to leave it empty
Purely decorative images, background textures and spacer graphics should have an empty alt attribute rather than a description. That tells a screen reader to skip it instead of reading out a pointless label.
Empty is not the same as missing. A missing alt attribute makes some screen readers read the file name out loud, which is how a visitor ends up listening to IMG underscore 4471 dot jpeg.
A worked example
A tree surgeon has a gallery of thirty jobs. Every photo has alt text naming the work and the town: a mature sycamore being sectionally dismantled over a conservatory in Hale.
The gallery is now readable by a screen reader, and those photos can show up in Google image results for the work and the place. The firm gets image traffic from people searching for that exact job, which the text on the page never would have caught.