This question is coming from someone who either committed fornication or did something that they know has opened the door to the devil and for some reason they think God is punishing them.
Well, if you ‘re born of God, God does not punish His own, He can chaise or rebuke but not punish. however, we reap what we sow. So it’s not God punishing. It is you reaping what you sowed. The devil is very legalistic, so he uses that opportunity to do what he has to do. You gave him place, you opened the door for him, you said yes to him, so you gave him power to do to you. God is not doing anything to you, you opened the door; and you can tie God’s hands from fighting for you when you do that (as ridiculous as it may sound).
What Do I Do?
If you have sincerely repented, then simply rest in grace. Don’t try to cast out the devil yourself. First reconcile with God, come into worship, spend time in worship and reconnect truly. I say this because if you think God is punishing you then your relationship with Him is not exactly as it ought to. He is the only one who can help you, you can’t even help yourself. So come back into worship, play worship music and meditate with Him so that He can speak to you. Our God is fearful in praises, when you engage in deep worship and His presence fills your space, that demon will run away.