How do you change a mass Airflow Sensor on a 1997 Subaru legacy
Do you have a MAF code? I wouldn't replace it until you spent some diagnosing your issue. The MAF is the last thing to replace. Changing it is easy, disconnect an electrical plug and remove it from the air hose and or box.
I agree with the first post, make sure the sensor is the problem and not something else? Note the picture. The left end of sensor has 4 bolt holes, so you remove those, probably attaches to air filter box? The other end, is where the air duct attaches, probably held on with a clamp of some kind.