Top-Down
Eliminate the top rows of viruses first. As the level continues, the pills will start to descend more and more quickly. If you still have some viruses near the top of the jar by the time the pills reach full speed, you may not be able to land pills on top and will have to start building pills up from underneath, especially the ones near the sides of the jar. This creates a lot of mess, as your jar fills up while you try to defeat a handful of viruses.
Colors
Place pills where both ends can do damage to viruses. If blue and red viruses sit beside each other, place a blue-red pill on top of them horizontally to effectively use both sides. Also, avoid focusing only on one or two colors of virus. If you have 10 yellow viruses at the end of a level and no other colors of virus, any blue-blue, red-red and blue-red pills you get will all be useless and will create clutter.
Combos
Arrange your pills to kill viruses in combos when you can. For example, stack a blue-yellow pill with the blue side on a blue virus and the yellow side hanging over a yellow virus. When you kill the blue one, the yellow pill remnant will fall down onto the yellow virus. You can also stack pills vertically to achieve the same result, but only if you kill the uppermost virus when the pill lands.
Alternative Kills
You need not only kill viruses from above. You can stack pills underneath or beside viruses to destroy them. For example, if you see two red viruses side by side, place a uni-colored red pill horizontally on either side to defeat them. Also, if you see two spaces between two blue viruses, put two blue pill ends between the two, killing the viruses from above and below at the same time. This strategy also works if you accidentally play the wrong pills on top of a virus and don't want to put the work into clearing them.
Unusable Pills
As you near the end of a level, you'll find that Mario will start throwing pills you don't need. Make sure you clear an area to deposit these. Don't just pile these pills in the corner: Arrange them so you can connect four of the same color in a row to clear them, the same as viruses. You don't know how many pills Mario will throw before you get the ones you need.