What is an alt text?
Alt text is short for Alternative Text.
It is a value placed inside the HTML code to give information about an image.

It tells the search engines and visually impaired users what the image on the page looks like since they can’t “see” it.
For visually impaired readers, the alt text is read aloud by a screen reader to describe the image.
Alt tag, although important, has no direct impact or use for most sighted users.
The only scenario that I know where alt text becomes useful for sighted users is when the images fail to load. Then the text becomes visible and describes the image.
It is good for SEO: Alt text is a major factor in SERP rankings. Google analyzes it to identify whether the images on the page are beneficial for the user or not. For example, an image of a mobile phone in a historical article will confuse the crawlers; consequently, Google will push the site down and promote sites with optimized images that benefit all kinds of readers.
Helps people with accessibility: Alt text gives the screen readers information about the image, which they read aloud, helping readers with accessibility. Furthermore, it also benefits readers who have difficulty identifying colors or get irritated by bright palettes when they disable the images.
Decisive for Rankings: Google puts high emphasis on webpages that fulfil the user’s needs and enhance their experience, whether they want to buy, consume, or learn. An Image is an experience-enhancing tool to clarify complex information and make the content more memorable. Hence, pages that have high-quality, optimized images do better than bland ones.
Protects from legal issues: Small and big websites are getting sued left and right for not following WCAG (Web Content Accessibility Guidelines) guidelines and ADA compliance. To put it simply, they are facing legal troubles just for not writing alt texts within the HTML. Well, the extent of the issue depends on the industry you operate in, the size of your organization, and the level of emphasis on compliance with accessibility laws.
Provides Keyword Opportunities: Alt text allows you to insert targeted keywords naturally, improving the topical relevance of the content.This mutually benefits both you (SEO) and Google to get additional context about the image. And since search engines can’t “see” the image, they heavily rely on the alt text to match the image’s keyword with keywords searched by the user.
Absence of the alt tag will affect three areas:
Without the alt text, visually impaired readers who rely on screen readers will be devoid of any meaning that the image could’ve provided. The screen reader will read aloud the image’s filename, which is really not helpful.
Result: You lose visibility in image search results and organic traffic.
Result: Reduced keyword density, which affects topical relevance and Keyword match or relevance with the user’s searched keyword.
Result: It can cause a drop in search engine rankings and visibility. Google’s indirect penalties slowly make the page less relevant, discoverable, and rank low. This is to show the utmost importance of alt tags for Google and its users.
Users with screen readers will be most affected by the unavailability of alt text, as screen readers won’t be able to describe the image on the page. This will negatively affect their overall experience and may force them to bounce off the page. For sighted users, the alt text appears when a page fails or loads slowly, which helps them to imagine what the image can be about.
An SEO-friendly image is one that clearly describes the context of the image to the search engines. Check these three key factors before you write alt text:

Let’s answer those questions in the context of this image. The image is taken from a blog that explains the meaning behind this painting; therefore, the role of the image in the blog is to showcase the artwork “Faun by Moonlight”.
Second, in the absence of the image, the readers have to rely on their imagination, which can lead to misinterpretations. The image and the alt text eliminate the confusion and show the reader the actual painting.
Now the surrounding content depends on the topic of the article. Suppose the topic of the article is “Top 10 most intriguing paintings”, then the alt text would be “Faun by moonlight by Léon Spilliaert is the 5th most intriguing painting”.
Your alt text will be useful for the search engines only if it's descriptive. Hence, you have to write specific, not generic.
Use this formula: [Specific Subject] + [Action/State] + [Details]
Here’s an example:

Bad: A player kicking a ball or a bicycle kick goal
Good: Wayne Rooney of Manchester United scored a bicycle goal against Manchester City.
Add keywords that
Screen readers often cut off longer alt text; therefore, focus on keywords and remove unnecessary words, such as “image of”.
The steps above will help you write SEO-friendly alt text, but it is better to recheck the alt text before placing it in the HTML value. Align the image and the description, check for keywords, importance, etc.
It is important to know what the best practices are for writing the alt text because any mistake can cause severe damage to your SEO.
Alt text is a helpful element for search engines and visually impaired users. It tells them what the image on the page looks like, and what purpose it serves.
It is a major factor in rankings as it directly influences users' experience. And its absence affects three key areas: Accessibility, SEO, and User Experience.
By following the steps and best practices, you can make sure that your images rank, provide context to search engines, and help users with accessibility.