: Pipes running through unheated crawl spaces, attics, or exterior walls are highly susceptible to ambient cold.
: Keep your drains clear of organic buildup by using enzyme-based cleaners or scheduling annual professional cleanings. drain freeze
If the frozen pipe is accessible (e.g., under a sink in a cabinet): : Pipes running through unheated crawl spaces, attics,
If your query referred to (a specific product or method for killing drain flies/fruit flies): drain freeze
Preventing a drain freeze is much easier than fixing one.