Use a/an to introduce something; use the when it becomes known in the conversation.
First mention: a/an + singular countable noun. Later reference: the + same noun.
Do not use 'the' for first mention unless it is already specific/known.
Have I mentioned it before? If yes, use 'the'.
💡 This is one of the most common patterns in English storytelling: I saw a dog. The dog was barking.
✓I bought a jacket. The jacket was expensive.
✗I bought the jacket. A jacket was expensive.
Use a/an to introduce; use the when referring back.
✓She met a teacher. The teacher helped her.
The second sentence refers to the same teacher.
✓We stayed in a hotel. The hotel had a pool.
The hotel is now specific because it was mentioned.