If you cannot avoid the person who causes you to lust, you'll need to find a healthier way to interact with them. One option would be to only spend time together when you are with other people. This will help keep you from saying or doing things you shouldn't. If even spending time only in groups isn't helping, another option is to spend time with them only in places like a church, temple, or other holy meeting place. God will protect you and help you focus only on Him and not on your lustful thoughts. When you look at them, make sure you focus only on their eyes and not on any body part which excites your lust. They say that eyes are the window into the soul, so focus on their eyes in order to see their soul. This will help make you more respectful and remind you how God would want you to treat them. Only do things with them that respectful friends would do. Do not do activities which may seem like dates. Just look at any situation you're in and think about what your grandmother would say about what you're doing. If she would approve, then you're probably okay. Touching them, even if you just touch them in reasonable places like the hand or arm, can sometimes make lustful thoughts worse. Try not to touch them at all, if you're really having trouble. This can help a lot. If you really can't keep your behavior in check around your boyfriend or girlfriend, it may be time to get married. This is God's intention and why he created husbands and wives, so that they can exercise these feelings in a way that pleases him.  Just keep in mind that you should marry someone who is a good match, spiritually, physically, and mentally, for you and only get married if you are ready to be serious about each other. If you can't take your relationship that seriously, you may not be ready for a sexual relationship. Getting married to give yourself an outlet for sexual feelings should be a last resort. Marriage is a serious undertaking and should not be approached lightly.

Summary:
Hang out in groups. Spend time together in safe places. Look at their eyes. Partake in friendly activities. Do not touch them. Do right by the object of your affection.