This is a bad idea, it can ruin the sensor. Some folks recommend using alcohol because it’s usually on hand, and can clean the sensor. Often, the mass airflow sensor really only needs cleaning when they go bad.
Here’s a fantastic video on how to diagnose a bad MAF sensor using a multimeter from Ratchets and Wrenches on YouTube. There are other codes related to the mass air flow sensor as well, but these are the most common ones.