I took one of my pills but still had heartburn
I'm sorry that the pills you took didn't effectively treat your heartburn. What do you plan to do about your heartburn now?
I have medication for my heartburn, it didn't work unfortunately.
It would be best to inform your doctor that the heartburn medication is ineffective for you. This will help you to have a treatment that works.
The doctor told me that I should just go back to focusing on reducing my stress.
Stress can be a major cause of many disorders. However, if reducing your stress is not helping, it's important to  let your doctor know or seek out a second medical opinion.