The Mass Airflow Sensor will eventually get dirty and should be considered a service item.
Before spending good money on a new MAF, it is worth checking to see if the old one is the cause.
Remove the air intake trunking and the MAF housing.
At some point the airbox lid on mine had been incorrectly fitted, the tags on the rear edge had not been located correctly before pushing the lid towards the rear of the car.
This resulted in the centre tag being pushed against the slot frame, leaving a gap between the lid and the body. This allowed dust in downstream of the filter.
Living around crop farms, it was inevitable that during the harvest season, dust from the combine harvesters would have got to the MAF.
Wiping the intake grill of the MAF with some clean tissue resulted in a fair amount of dust coming off. Proof that it had got past the filter.
There is no fixed rule, but you can pretty much say that 100,000 miles is a ball-park figure to start looking in that direction.
I would add that if, like my car, the airbox lid has not been put on correctly, that figure may come down.
I bought the S60 with 90,000 on the clock and it had been giving the former owner a fault code for over 18 months.
Given that when the garage replaced the cam belt tensioner, they fitted the wrong type. To try and cure this error the garage replaced three of the five injectors (?). Add on the piss poor way the airbox lid had been put back in place, distorting the whole airbox, I would say that it had been given a really crap start in life.
I have no doubt that a well looked after car will not need a new MAF until double that figure (200,000 miles), perhaps even more. But then they would not have had a P2188 code, would they?
MAF sensor (including housing) replaced with Bosch original.
Intake trunking washed and dried to remove dust downstream of air filter.
Air filter housing mullered back into shape and lid fitted correctly.
Air filter replaced as per service interval and airbox vacuumed out.
There are cheap Chinese MAF sensors available. My research showed that in most cases, the buyer just wasted the 50 pounds sterling asking price and eventually bought a Bosch.
Buy it once, buy an original.
Follow this link for a full explanation of diagnosing a P2188 - System Too Rich at Idle (Bank 1) fault code.