It is not through anything that we can do to deserve His favor. Since it is the gift of God to those who believe, we can depend on Him to make it possible for us to keep that gift. It is clear from what follows these verses that Paul was able to keep going in the right direction because of his faith. He might not be able to see the way out, but he knew that God had a way for him. The first thing to get clear is that we must not blame God for them.
Temptations come from the evil one.
They come from our own desires. God does not tempt us. He does make it possible for us to endure temptations. His Son Jesus endured them. To be tempted is not sin.