One of the modern invention that is simple yet powerful is a p-trap. As the schematic indicates, it is shaped like alphabet U and commonly seen under sinks, toilets, etc.
The wastewater drains through the sink and flows through the p-trap into the sewer line. The decomposition of solids in the wastewater release gas that is not only offensive odor but possibly methane, which is a combustible gas. P-trap when holding water acts like a plug that prevents odorous gas from rising through the toilet, sink, or floor drain.
When the drain is not used for an extended period, the water inside the p-trap evaporates, resulting in the foul odor.
Merely filling or by flushing up should fill up the p-trap with water, which would rid of the foul smell. If the foul odor is persistent, call a professional plumber.
If you are in the market to buy or sell, contact Poogle (972)4087402, an experienced and knowledgeable REALTOR(R).