Do you know what a local variable is?
By definition it is a variable declared inside a function.
Exactly. So if you have a ton of class-wide variables that are only being used in one function, it would make sense to convert them to be local variables then. Because as you say, by definition they would only be relevant to the function they’re being used in.
Do you know what refactoring is?