This article suggests maybe you can control dreams.I'm ok with myself most days. I make it through. I've done a lot in my work I am proud of and that other people compliment me on. I try to embrace that and to try feel ok about myself. But most nights (at least 5 nights a week), I have vivid dreams where I am a failure. So I feel like a failure every day of my life because of these dreams. I am not sure if you can control dreams
https://www.scientificamerican.com/article/how-to-control-dreams/
There are a few paragraphs that you might find helpful.
You might consider getting some professional help to make it happen though.
It would be wonderful to stop the dreams, but have you got support in the meantime? Have you got someone you can hash these feelings out with?