The best way to prepare your drains before leaving is to run water through every sink, shower, bathtub, and floor drain for several seconds to refill the protective P-traps.
For longer trips, experts recommend using proper drain plugs, silicone covers, or sealed barriers, and some homeowners add a small amount of mineral oil on top of the drain water to slow evaporation.
Other simple steps can also prevent problems, including emptying trash cans, cleaning garbage disposals, protecting pipes in freezing weather, and considering shutting off the main water supply during extended absences.
The viral sink cover trick is based on a real plumbing concept, but a proper water seal and secure drain protection are much more reliable ways to keep your home fresh while you travel.