Despite insecure masculinity and the usual teenage angst, Xander was a very competent member of the Scooby gang in high school. Upon reaching adulthood, Xander's status downgraded. He lived in his parents’ basement while his two best friends were attending college, following the expected path to success. His fellow Scoobies, Willow in particular, gained power while Xander became less and less relevant. In season five, he finally got out of his parents' basement and got a job and an apartment, but his main success was his relationship with Anya. Naturally, this lead to a marriage proposal.
And to a wedding that he didn't go through with. Xander was simply not ready for marriage, and the shadow of his father and his parents' miserable marriage was enough to keep him from actually marrying Anya. Anya, unsurprisingly, didn’t appreciate being dumped at the altar and then told, in essence, “We can still date." That relationship was over.
While Anya’s attempted murder of Xander in Entropy is one of the most horrifying actions of any character on the show, Entropy also marks a low point for Xander. He tried to kill Spike, simply because Spike slept with the woman Xander left at the altar. Then Xander reamed Anya out in needlessly vile terms: “You let that evil, soulless thing touch you. You wanted me to feel something? Congratulations, it worked.[...]I look at you ... and I feel sick. 'Cause you had sex with that.”
And then he found out that Anya wasn't the only woman in his life who had slept with Spike.
When Buffy reached out to Xander in Seeing Red, his initial reaction was all about himself. His intense hypocrisy (telling Buffy he never forgot who Spike was when he let Spike take care of Buffy's little sister; telling Buffy off for sleeping with a murderer who refrains from killing due solely to outside forces as if he hadn't just almost married one) has literally made me swear at the screen on at least two different watches. Buffy and Xander's conversation ends on a bitter note.
And then Xander encounters Warren in a bar.
I knew from the first time I watched this episode that this scene with Warren was significant, but I've never been able to quite put my finger on why. I think it's a weakness of Xander's late S6 arc that this isn't clearer. In the scene, Warren's being the bad guy, and Xander tries to play the hero. Warren slut shames Anya, which provokes Xander into hitting him. The whole exchange is a mess of macho man insults (“You hit like a girl.”) and mocking each other’s ability to make it with the opposite sex (“See now, I think it's the daddy thing that's throwing her. 'Cause incest , not that sexy.”). As one would expect, powered-up Warren defeats Xander the super-power-free Scooby. The only thing that saves Xander from getting a serious beating is Jonathan, who has enough of a conscious and connection to Xander to convince Warren they have to go.
But Xander, for all his insecure masculinity, has one thing going for him: His respect for Buffy as the most badass person in the room. And, as Anya criticized him for in "I'll Never Tell", his first response to trouble is to make sure Buffy knows the story.
When Xander shows up at Buffy's, and sees Spike’s coat on the stairs, his first response is macho anger. “This what you call not seeing Spike anymore—” When he finds Buffy in the bathroom and realizes that Spike tried to rape her, his first instinct is to hunt Spike down, and presumably beat up and/or kill the vampire.
But Buffy says, “Please, just…don’t.” And he doesn’t. And that, to me, is the moment when Xander really starts to turn around.
At the end of the episode, Buffy and Xander hug and make up. Xander admits that Buffy might have told him about Spike “if I hadn't given you so many reasons to think I'd be an ass about it.” When Buffy observes that they’ve “all done things lately we’re not proud of”, Xander says, “I think I’ve got you beat,” a contrast to his nasty comment earlier about not having slaughtered half of Europe.
Then, Tara dies. Willow goes dark side, kills a man tries to destroy the world, and for the first time in a long time, Xander and Willow's arcs combine.
Xander and Willow have always loved each other. That never went away. The kiss on the forehead in The Body is one quiet remind of that. But by season 6, they’d drifted apart. Willow was a lesbian witch attending college. Xander was a solidly working-class guy living with a demon. But when Xander was just starting to crawl out of his dark hole, and Willow’s fell headfirst into hers, it’s him who brings her out of it. Buffy, fresh from her depression, not yet entirely out of it, a depression caused in part by Willow’s actions (“You're trying to sell me on the world. The one where you lie to your friends when you're not trying to kill them? And you screw a vampire just to feel? And insane asylums are the comfy alternative? This world? Buffy, it's me. I know you were happier when you were in the ground. The only time you were ever at peace in your whole life is when you were dead. Until Willow brought you back.”), was unable to do it.
But Xander and Willow always had a bond that even Buffy couldn’t quite touch. They’ve known each other longer than anyone save their families--and both of them have less-than-positive feelings about their families.
I don’t think Xander ever actually said the words “I love you” to a wide-awake Willow prior to Grave. The moment in Becoming Part 2 when he realized it himself is powerful--but I don’t think he ever said it directly to Willow.
Xander has loads of issues with masculinity. His life has fallen apart because he can’t play the stereotypical male role he thinks he is supposed to play. A role he can't fully embrace because he’s afraid of being a toxic macho man like his father. Telling his best friend that he loves her is the exact opposite of macho masculinity. He’s not being like his father. And furthermore, instead of being worthless and useless as he fears he is, he saves the damn world. And not with masculinity, but with love—an emotion generally categorized as feminine. He is useful by playing a more passive role. By being the peaceful person who talks the violent person down from their violence.