One of the coolest things that can happen in an anime is when two former enemies join forces to achieve a common goal. Often, this happens when a villain decides to put aside their villainous ways and join the good guys - that's what happens when Sasuke decides to help Naruto take down Madara in Naruto. But at other times, it's merely a temporary truce - Hisoka from Hunter x Hunter has no desire to side with Gon and Killua for any longer than is convenient for him.
Whether these hero/villain alliances are heartwarming or awesome, they offer a new lens through which to look at both characters, and a rare opportunity to see two very different characters cooperate.
Goku is an unabashedly heroic person who lives to fight evil. Frieza blows up entire planets because he can. One would never expect these two to see eye to eye on anything, but by the end of the Tournament of Power they're both completely on board with defeating their mutual enemy, Jiren, and saving multiple universes in the process. Frieza happens to be dead at the moment, so part of the reason he's helping his former arch enemy out is that Goku promised to bring him back via Dragon Ball. The ensuing fight is one of the most dramatic of any the franchise has ever seen.
Hisoka is the type of villain who will team up with basically anyone if it furthers his personal goals. Occasionally, those goals involve protecting the good guys because he wants to be the one to kill them later on. That's what leads him to help out Gon and Killua when they need him. In one case, he joins them in a dodgeball game on Soufrabi Island, in a battle against a group of pirates who they must defeat if they want to get their hands on a rare item. The three of them make a formidable team, especially once Hisoka's Bungee Gum attack is added to the mix.
Ed and Ling doesn't exactly want to help out a homunculus, and the homunculus in question isn't particularly interested in helping them. But despite their animosity for one another, they join forces temporarily in order to take down a mutual opponent - Gluttony's stomach. The three of them have been swallowed by Envy's partner in crime, and none of them have the strength or knowledge to escape on their own. It's only through working together that they manage to leave that labyrinth - but they're still enemies when it's over, thank you very much.
Inuyasha and Sesshoumaru are locked in a bitter feud throughout most of the series. Sesshoumaru loathes his half-human brother not only because he isn't a full demon, but also because he's jealous that their father gave Inuyasha what he perceives to the be a superior sword. The two fight more than once, and at some point Sesshoumaru teams up with Naraku to take Inuyasha down.
But as the series progresses, Sesshoumaru becomes disillusioned with Naraku, especially when he attempts to kidnap Rin, a human child who he has grown affectionate toward. For this and many other reasons he decides that Naraku needs to be taken down. In the final battle of the series - which ends in Naraku's defeat - Sesshoumaru finally puts aside his resentment toward his brother and works with him and his team to take down their mutual enemy.