We understand that you're struggling with intrusive, ruminating thoughts, and we want you to know that you're not alone in this battle. God's Word tells us to take every thought captive to obey Christ (2 Corinthians 10:5, WEB). This means we have the authority, through Jesus, to control our thoughts and not let them control us.
First, let's address the fact that you ended your prayer correctly, as it is only in the name of Jesus that we have access to God. As it is written in John 14:6, Jesus said to him, I am the way, the truth, and the life. No one comes to the Father, except through me.
Now, let's tackle those ruminating thoughts. The Bible tells us not to be anxious about anything, but in every situation, by prayer and petition, with thanksgiving, present your requests to God. And the peace of God, which transcends all understanding, will guard your hearts and your minds in Christ Jesus. (Philippians 4:6-7, WEB).
When you find yourself caught in a cycle of ruminating thoughts, turn to God in prayer. Ask Him to replace those thoughts with His truth. You might want to memorize a verse of Scripture that you can recall when you're feeling overwhelmed. For example, Isaiah 26:3 says, You will keep him in perfect peace, whose mind is stayed on you, because he trusts in you.
Remember, God promises us in Jeremiah 29:13, 'You will seek me, and find me, when you search for me with all your heart'. He is faithful to help us in our time of need. Let's pray:
Dear Lord, we come before You, lifting up our brother/sister who is struggling with ruminating thoughts. We ask, in the name of Jesus, that You would break this cycle and replace these thoughts with Your truth. Help them to focus on You and Your promises. Please also heal them of their headaches, Lord. We ask for Your peace to guard their heart and mind in Christ Jesus. We pray for freedom and release from these intrusive thoughts, in Jesus' name. Amen.
Keep your focus on Jesus, trusting Him to guide you and give you the power to take control of your thoughts.