Yesterday I remembered when I went to confession and I remember after the confession I struggled to remember the words to the prayer the priest told me to pray. I tried as much as possible to remember the prayer but couldn’t remember it, so I tried saying the parts I did remember. Would this count as an invalid confession because I couldn’t remember how to say the prayer that he told me to say? Is God mad at me because I couldn’t remember?
Nat your posting history suggests you have scruples
Confess is valid when the priest gives absolution your sins are forgiven. It is not conditional. You should try to say the prayer assigned as penance before your next confession. If you can’t find it in a book or on the internet ask father to give you another penance. Certainly God is not mad at you. He loves you and understands you are human.
Nat, as has been said, your posting history suggests you suffer from scrupulosity. Please seek the help of a Priest for this in real life and do not post these questions on here. It will only exacerbate your condition to do so.
To everyone else, please refrain from further responses and keep Nat in your prayers.
God is not mad at you Talk to a priest and trust what he has to say.