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 & Frieza Take Down Jiren In 'Dragon Ball Super'
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.
Envy, Ed, & Ling Escape Gluttony's Stomach In 'Fullmetal Alchemist: Brotherhood'
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 & Sesshoumaru Defeat Naraku In 'Inuyasha'
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.
Naruto & Sasuke Save Konoha In 'Naruto'
Sasuke and Naruto have spent the entire series alternating between being comrades, rivals, and outright enemies, but by the end of Shippuden they are clearly on opposite teams. Naruto is attempting to protect his nation from destruction at the hands of Madara, while Sasuke is largely uninterested in helping because of the intense grudge he bears against Konoha after he found out the government orchestrated his family's slaughter. He eventually realizes exactly how dangerous Madara is, and decides that he can't sit by and let him destroy the world. He once again sides with his former team, and gives up his villainous ways.