Several months after a major wreck my 4X4 1988 pickup started misbehaving one day and the trouble code said it was the mass airflow sensor. I went to the local dealer and they told me they did not have one in stock but it would cost $680. So I pried the plastic top off of mine, noted that basically it was a potentiometer, attached an analog type volt ohm meter and could see how sweeping the mass airflow sensor back and forth revealed the resistance reading went from smooth, to "scratchy" to back to smooth again. This is similar to what occurs when you have a scratchy volume control on a radio. I kewn what to do to fix that. I poured a little LPS-1 into the wiper area of the device, observed how the resistance reading got much smoother, and glued the top back on. I had no more trouble with that component, drove the truck for 3 more years, then gave it to my brother, who drove it for years and then sold it. The guy who bought it had no problems with the truck until he pulled into a gas station one day, forgot to set the parking brake, and it rolled down the hill into a ditch and was totaled.
So, first, test the airflow mass sensor with an ohmmeter, and if it looks "scratchy" then, open the top, pour a teaspoon of LPS-1, and see how that works. It's easy to do and costs just about nothing.
And put some LPS-1 into the electrical connectors, too.