Don’t think something is faulty and guess, leading to buying a part and replacing it, only to find the fault still exists because there was no actual fault with the part/sensor in the first place.
Then buy another part and try that and so on. Many workshops even do this.
There are ways of sorting through things to get supporting evidence to change a faulty part. Gathering codes, current and historical, is the start. They are the clues that start the investigation.