Quick answer: To evolve Swirlix into Slurpuff, you must trade the Pokémon with another player while it is holding a Whipped Dream.

Where to find Swirlix
Before you can evolve it, you need to catch a Swirlix. This Fairy-type Pokémon appears in several specific locations around Lumiose City. It is commonly found in a hidden area within the Passage de la Felicite; you can reach this spot by climbing nearby scaffolding to the roof and jumping down into the courtyard. Another reliable spawn point is the rooftop south of Rouge Sector 6, which is accessible via the holovator.
For players looking for a stronger variant, an Alpha Swirlix spawns at level 29 on the roof of a building west of the Nouveau Cafe in Magenta Sector 3. Swirlix may also appear atop market stalls, such as those near Nouveau Cafe Truck No. 2 in Bleu Sector 5, or inside 2-Star Hyperspace Wild Zones if you have accessed the Mega Dimension content.

How to get the Whipped Dream
The Whipped Dream is a consumable evolution item required for this specific transformation. It is not sold in standard shops initially. You can obtain two Whipped Dreams by completing Side Mission 14: "Slurpuff’s Café Visit."
This quest becomes available on Estival Avenue after you finish Main Mission 6. Once the mission is complete, the item is added to your inventory. If you have already used the guaranteed items from the quest, additional Whipped Dreams can be obtained as rare drops from completing Infinite Royale matches in the post-game.

Completing the evolution trade
Once you have both the Pokémon and the item, follow this process to trigger the evolution:
Step 1: Open your inventory and give the Whipped Dream to the Swirlix you intend to evolve.

Step 2: Open the menu with X, select "Link Play," and then choose "Link Trade." You can trade locally with a nearby player or over the internet if you have a Nintendo Switch Online membership.
Step 3: Select the Swirlix holding the item and confirm the trade. The Pokémon will evolve into Slurpuff immediately after it arrives in your partner's game.
If you do not have a specific partner to trade with, the community trade code 0098 0098 is frequently used by players seeking to swap Swirlix and Spritzee for their respective evolutions. Always verify that the incoming Pokémon is holding the correct item before confirming the trade with a stranger.