Your desire to be forgiven and to have your eyes fixed on God is itself a work of His grace in your heart, and it is good that you bring this honestly before Him.
What you saw and the lust that followed grieves you because you know it is not good for the soul. Scripture is clear that to look with lust in the heart is already to commit adultery in the heart, and that kind of desire, if followed, destroys the soul and brings dishonor. It is part of what the Bible calls the lust of the flesh and the lust of the eyes and the pride of life, which are of the world and not of the Father. The world and its lusts are passing away, but the one who does the will of God abides forever. To love the world in this way is to commit spiritual adultery against God, and friendship with the world is enmity with God.
It is important to understand that temptation itself is not sin. Every person is tempted, and even Jesus was tempted, yet without sin. God does not solicit anyone to evil, that solicitation comes from the enemy and from our own desires. Temptation often comes as a promise of immediate fulfillment if we will just turn aside from God's path. The sin is not in being tempted, but when desire is allowed to conceive and we yield to it and walk after the flesh. When lust is conceived it brings forth sin, and sin when it is finished brings death.
In every temptation there is a decision to be made whether to walk according to the flesh or according to the Spirit. You do not have to yield to the flesh. Through faith in Jesus you are dead to sin and your life is hidden with Christ in God. You have been crucified with Christ and raised with Him, and you no longer need to be mastered by the flesh. Temptation is common to all people, and God is faithful. He understands the pressure you feel, because Jesus faced temptation with great intensity and did not fall, so He is able as your great high priest to have mercy and help you in the moment of pressure.
Forgiveness is offered fully through Jesus Christ alone. Where sin abounded, grace abounded much more, but that grace is not a reason to continue in sin. How can we who died to sin still live in it. If we confess our sins, God is faithful to forgive because of the sacrifice of Jesus on the cross. Forgiveness is not a matter of counting how many times, but a matter of the heart. Come willingly and ask Him to give you a clean heart and to take away what entangles you.
Your prayer to look to God immediately when tempted is exactly right. The purpose of prayer is not to get our own will done so we can consume it on our lusts, but to align our hearts with God's will. When temptation comes, turn at once to Him in prayer. Cry out for help before you react, for He will give you the capacity if you are willing. Also hide His Word in your heart, for it is the power against temptation. When Satan tempted Jesus in the three areas of the lust of the flesh, the lust of the eyes, and the pride of life, Jesus answered with what is written. You can do the same. Learn to recognize which way the temptation is coming and answer it with Scripture, and choose to starve the lust rather than feed it. You cannot fulfill the lust of the flesh, you can only starve it to death by not providing for it and by setting your affection on Christ.
I pray for you now that God will forgive you through the blood of Jesus and cleanse your heart. May He lift your eyes from what is empty and fix them on Christ, and give you strength to walk in the Spirit and not fulfill the desires of the flesh. When the temptation comes again, may you immediately call on Him and turn to His Word, remembering that you are dead to that old way and alive to God. May He make you pure as Jesus is pure, and keep you in His grace day by day.