You need to keep the candy floating in the air without touching any ropes or bubbles, and without going off screen. This is tricky, but luckily there exist a few spots to get it fairly easily. Try Level 2-23. From the start, cut the two ropes holding the candy VERY quickly so it falls straight down. Then keep using the bottom puffer to blow it back upwards. It is important to cut the two ropes with a very quick swipe or else the candy will fall ever-so-slightly crooked and you wont be able to keep it airborne for 30 seconds.
Alternate method: Level 4-17. Just cut the rope, pop the bubble and let the candy go in and out of the magic hats. You don't have to use the air puffers like the other 2 solutions. This doesn't work every time because sometimes after about 15 seconds the candy just falls. Give it a few tries.