Well, it’s pretty tricky when the near occasion of sin is your own church. Most other occasions for sin can be avoided, but you can’t avoid going to church. If it’s only one particular girl that causes you to sin, then you could try going to a different service. But I’d guess if one girl has this affect, then other girls at other services will be a potential problem too.
Firstly, are you sure your thoughts are sinful? Finding girls attractive is fine; God intended this. Lustful thoughts are not, or more specifically dwelling on lustful thoughts. For most men, lustful thoughts enter our consciousness without our intention, so we can’t help this, but we can avoid dwelling on them. Since it will be impossible to avoid seeing attractive women at church and in other parts of our lives, you need to find ways to tackle this problem…the dwelling on lustful thoughts. Being at church should be the easiest occasion to find something else to focus on to eliminate impure thoughts…the tabernacle, the altar, any icons around the church. It’s hard to be thinking impure thoughts when you focus your gaze onto a crucifix. I presume your party will be in a church hall or the like, so might not have icons around, but I presume your priest and maybe other religious will be there, so think of what the priest represents to the parish, as Christs representative…again, you bring your thoughts back to Christ, and the more you do this, the harder it is to indulge impure thoughts. Good luck, and I’ll say a prayer for you tonight.