It's uncanny that I'm seeing this now because I had a bit of a problem writing a short fiction I needed to post yesterday and I texted my friend with tears and told her I was stuck and I couldn't write it. She said these exact things you were saying, though not so elaborately and told me to affirm with my eyes close, "I can continue writing. I can do it. I can complete it." Like ten times.
It worked. It worked so beautifully because I believed it would and I couldn't have been happier.✨
I'm so glad to hear it worked. We all need more friends like yours!