How can I restrain myself from doing foreplay with my girlfriend?
"Now concerning the things of which you wrote to me: It is good for a man not to touch a woman" (I Corinthians 7:1).
The simple answer is to keep your hands off of her body. Rather than thinking about your desire for sex, think about your respect for her honor and who she is. If you keep your mind in the gutter, it will not be surprising if your body follows. "The lamp of the body is the eye. If therefore your eye is good, your whole body will be full of light. But if your eye is bad, your whole body will be full of darkness. If therefore the light that is in you is darkness, how great is that darkness!" (Matthew 6:22-23). You go where you focus on being. If you focus on being an honorable man, then you'll tend to behave that way. If you focus on sex, you'll have your clothes off before you know it.
Along with that, it must be a two-way street. You might have all the right intentions of being a proper Christian man to this girl, but if she doesn't have the same standards, you will be fighting a losing battle. "Do not be deceived: 'Bad company corrupts good morals'" (I Corinthians 15:33). Most men would find it hard to restrain themselves if the woman they are with is trying to pull their pants down. Unfortunately, more men want to have a girlfriend than to live righteously before God. There are times when you have to face the fact that the person you are with is not good for you. That is why Joseph ran, rather than stay. "And it came to pass after these things that his master's wife cast longing eyes on Joseph, and she said, "Lie with me." But he refused and said to his master's wife, "Look, my master does not know what is with me in the house, and he has committed all that he has to my hand. There is no one greater in this house than I, nor has he kept back anything from me but you, because you are his wife. How then can I do this great wickedness, and sin against God?" So it was, as she spoke to Joseph day by day, that he did not heed her, to lie with her or to be with her. But it happened about this time, when Joseph went into the house to do his work, and none of the men of the house was inside, that she caught him by his garment, saying, "Lie with me." But he left his garment in her hand, and fled and ran outside. And so it was, when she saw that he had left his garment in her hand and fled outside" (Genesis 39:7-13).
You can't expect to play with fire and not get burned. "Can a man take fire to his bosom, and his clothes not be burned? Can one walk on hot coals, and his feet not be seared? So is he who goes in to his neighbor's wife; whoever touches her shall not be innocent" (Proverbs 6:27-29). You can't go partway and then act surprised that you didn't stop where you intended.