The use of articles in English—”a,” “an,” and “the”—depends on several factors including whether the noun they precede is countable, specific, or indefinite. Here’s a breakdown:
A
● Use “a” before words that start with a consonant sound.
Example: a banana, a university (Note: “university” starts with a ‘y’ sound, which is a consonant sound.). It is also used with an indefinite or non-specific noun: I need a pencil. (Any pencil will do)

An
● Use “an” before words that start with a vowel sound.
Example: an apple, an honor, an MBA
Like “a”, it indicates an indefinite or non-specific noun: She is an artist. (Any artist, not a specific one).
The
● Use “the” for specific or previously mentioned nouns or nouns the speaker and hearers know:

Examples: The book on the table is mine. (You’ve mentioned this book before or there’s only one book on the table).
Please pass the salt. (Assuming there’s only one salt shaker being referenced)
I want the green apple, not the red one. (There are two apples. One is red and the other, which you want is green)
With unique objects or when there is only one of something or when the noun is specific in context:
The sun – we only have one
The president (Referring to a specific person who holds that position)

For general categories when discussed in a specific sense:
The giraffe is the tallest land animal. (Here, we’re talking about the species in general, not a specific giraffe)
In cases where the noun is singular and represents the whole class:
The computer has revolutionized our lives. (Here, “the computer” represents all computers)
Additional notes
No article is used for plural and uncountable nouns when speaking generally. Dogs are friendly. (General statement about all dogs). Water is essential for life. (Uncountable noun)
Cultural and idiomatic uses might dictate specific article usage:
Play the piano vs. play piano (In some contexts, no article might be used to suggest playing in general rather than a specific instrument). In US English, you go to the hospital. In UK English, you go to hospital.
Understanding these rules can help in using articles correctly, but remember, context often plays a significant role in article choice. Listening to native speakers and reading widely can also greatly enhance your grasp of these nuances.