Sounds like a fuel system issue, Would help if you posted the engine model,type,code numbers, I suspect you have a Briggs 24HP..?? the info we need is stamped into one of the valve covers (see example)
.......... click to enlarge
Usually the carburetor is dirty, which requires removal & THOROUGH cleaning, possibly a rebuild kit, also it would be of great benefit to THOROUGHLY clean the ENTIRE fuel system, the gas tank, shut-off valve and replace the filter and fuel lines, no sense cleaning the carb then re-introducing dirty fuel into it, we have the info to walk you through it, BUT as I stated, we need to know for sure, what exactly were working with, we await your info, ( pics of carb would be very helpful ) .. :thumbsup: