Narrative:

I took off from ZZZ; and the takeoff was normal. The smoke was extremely dense; and there were reports of IMC conditions due to smoke on the peninsula where I was headed to [location]. I had checked the FAA webcams; the nearest taf and metar. Where I was headed was VFR.I climbed out of ZZZ; and decided to climb above the smoke that was reported per PIREPS to top out at 2;800 feet. I kept climbing at full power and leaned the mixture; but I was climbing past 5;500 feet and the smoke still wasn't clearing. I was still climbing and turned southbound. At about 6;200 feet; the engine started sputtering; and lost power; and I immediately pulled on the carburetor heat. The engine went from 2;400 RPM to 800; then quit. I pitched for best glide and turned on a heading to ZZZ1. I tried to restart; but the prop was just windmilling. I [advised ATC]; and they said to take either runway xxl or xxr. I easily had enough altitude to make whichever runway I wanted. At about 3;000 feet; the engine started sputtering and producing power; however; I elected to continue to runway xx; since I didn't know what was wrong with the engine; and did not want to chance an engine failure again.all the ATC personnel were extremely helpful and I was really glad that they were there to help coach me along and give me the wind direction and keep the other planes out of the way while I expedited the landing. I believe I did as much as I could to maintain control and ensure the safety of flight.

Google
 

Original NASA ASRS Text

Title: Cessna 150 pilot reported a loss of engine power during initial climb; however; the engine recovered while he was accomplishing the landing.

Narrative: I took off from ZZZ; and the takeoff was normal. The smoke was extremely dense; and there were reports of IMC conditions due to smoke on the peninsula where I was headed to [location]. I had checked the FAA webcams; the nearest TAF and METAR. Where I was headed was VFR.I climbed out of ZZZ; and decided to climb above the smoke that was reported per PIREPS to top out at 2;800 feet. I kept climbing at full power and leaned the mixture; but I was climbing past 5;500 feet and the smoke still wasn't clearing. I was still climbing and turned southbound. At about 6;200 feet; the engine started sputtering; and lost power; and I immediately pulled on the carburetor heat. The engine went from 2;400 RPM to 800; then quit. I pitched for best glide and turned on a heading to ZZZ1. I tried to restart; but the prop was just windmilling. I [advised ATC]; and they said to take either RWY XXL or XXR. I easily had enough altitude to make whichever runway I wanted. At about 3;000 feet; the engine started sputtering and producing power; however; I elected to continue to RWY XX; since I didn't know what was wrong with the engine; and did not want to chance an engine failure again.All the ATC personnel were extremely helpful and I was really glad that they were there to help coach me along and give me the wind direction and keep the other planes out of the way while I expedited the landing. I believe I did as much as I could to maintain control and ensure the safety of flight.

Data retrieved from NASA's ASRS site and automatically converted to unabbreviated mixed upper/lowercase text. This report is for informational purposes with no guarantee of accuracy. See NASA's ASRS site for official report.