Burnt food on cast iron is hard because the scorched layer has baked onto the surface. You can usually lift most of it with patience, warm water and a non-metal scraper. Work gently, and check the seasoning once the pan is clean.
Why burnt food sticks so hard
Once food scorches, its sugars and proteins turn dark and bond to the metal and the seasoning. The crust is brittle and tends to chip rather than wipe away. A thin layer may lift easily, while a thick one needs several rounds of work.
Scrape gently while the pan is warm
Let the pan cool until it is warm, then scrape with a wooden spoon, a plastic scraper or a silicone spatula. Lift the burnt bits in small pieces. Pressing hard with metal can scratch the seasoning, so keep the angle low and the pressure light.
Simmer water to loosen the crust
Add about a cup of water to the pan and bring it to a gentle simmer. Let it bubble for several minutes, then scrape again. The heat and water soften the crust so it lifts more easily. Pour off the dirty water once the crust has loosened, and keep the heat low.
Use a chainmail scrubber or baking soda paste for stubborn spots
If small patches remain, try a chainmail scrubber with a little warm water. It cleans well without taking a lot of seasoning with it. For spots that still hold on, you can make a paste of baking soda and water, let it sit briefly on the stubborn area, then scrub gently and rinse.
Check the seasoning afterward
Once the pan is clean, look at the surface. Dull, dry patches may mean the seasoning has thinned in that area. Dry the pan over low heat, then rub a thin coat of oil over the whole cooking surface. If the seasoning looks badly damaged, you may need to season a cast iron pan again.
Avoid steel wool and harsh tools
Steel wool and aggressive abrasives can remove seasoning quickly, and they can leave the surface uneven. They are usually more trouble than they are worth on a pan you want to keep in good shape. If the burnt layer is very thick, repeat the simmer and scrape steps several times rather than scrubbing harder.
Next time, a little more oil and moderate heat can help keep food from scorching in the first place.