Foils are opposites—characters so different from each other that they highlight the other’s traits and their own, simply though the contrast. Most often they’re totally different with maybe a shared trait or two, or really similar with a distinct difference. In either case, their differences are emphasized through contrast. Crafting foils in your characters is a great way to make them distinct and give them their own goals and agency and all that stuff a great character needs. Setting two characters side-by-side as mostly opposites will bring out the best—and the worst—in each of them. So let’s talk about that.
They should be more-or-less opposites. Mostly these are opposites in personality, but they can be opposites in morals, belief systems, motivations, and so on. They also don’t have to be black/white opposites. Where Alice is pessimistic and cynical, Suni is happy and hopeful about the world. Alice has a tight selection of likes in music, while Suni dances to anything. When Alice thinks, Suni acts. Despite her devil-may-care attitude, the thought of killing makes Alice sick to her stomach, but Suni’s killed—and would kill again—if her loved ones were threatened or if the victim deserved it. They do, however, share a trait of selflessness for people they really care about, even though Alice would hesitate to admit it. Neither is especially religious. Alice is agnostic, while Suni honestly doesn’t care.
A small tip: As far as your female representation, you should be careful about relying on the virgin/whore dichotomy when you’re setting up two female characters as foils. The virgin/whore dichotomy, when used, strictly ties up a woman’s sexuality with her morality. If she’s a virgin, she must be pure, good, kind-hearted, etc, etc, while if she’s had sex a few times, she’s a manipulative whore who is corrupt and rotten to the core (such as Lavinia and Tamora from Titus Andronicus, if you’re a Shakespeare fan). You can contrast an evil female villain with a goodly female heroine, but please bear in mind that a woman’s sexual activities should not be your go-to determiner for her morality, or vice versa.
They can agree on things. They’re not politicians who disagree just for the sake of disagreeing—unless that sort of thing is how your characters’ relationship works. Forcing them to disagree can make it feel forced. Also, if they have to fight at every occasion or if their polar opposite personalities keep them from getting anything done, then you risk dragging down the plot. It’s fun watching characters squabble for a bit, but squabbling with a purpose is preferable.
Shared traits can highlight their differences. If they both have a personality trait or a skill/ability but use it in a different way, that brings out their differences at their core. Maybe they’re both clever, but while he uses his cunning to steal jewels to sell and fund charities, she uses her cunning to try to take over her mother’s company with political and legal outmaneuvering. They’re both smart, clever people who can manipulate a situation to their advantage. But how they use that gift is what makes them foils. Similarly, a pair of foils that are equally stubborn will have them arguing over their different beliefs until they’re both blue in the face. Not only does their stubbornness come across clearly, but now we also know how much each of them cares about their side of the argument. We’ve got a touch of their passions.
Not all foils have to have some shared trait, but if you notice they’ve got something in common, that’s okay. Keep that. Play with it.