Generally averted in Code Lyoko. Though some classes at the start of an episode may have a coincidental link to future events (for example, a lecture about nuclear energy production happening just before XANA attacks a nuclear power plant...), the specific content of the lecture would hardly be of any help for the heroes, since Jérémie and Aelita know probably more than the teachers already. At best it will be mentioned as a joking aside. If the class directly influences the events, it's usually because it gives Jérémie an idea that he next tries out — like the biology class about ants that prompts him to create the "Marabounta".
Parodied in the American Dad! episode "Stan's Night Out". Stan watches a television show about gardening, where the host says that you can start a lawnmover with the first pull, if you stand on the back wheels. Later, when he's trapped by a ruthless crime lord in a shed, he sees a lawnmover, and proposes a wager; if he can start it ten times in a row, the bad guy will let him go. So, he stands on the wheels, pulls the rope... and the lawnmover doesn't start.
In what has to be a spoof, one episode has Ron tutoring Kim in Home Economics. Later on, Kim uses Ron's advice when Shego has her trapped in a giant industrial mixer. While facing certain death from the large mixer blades, Kim Possible grabs the mixers, stays/spins with it, follows it up into the air, lets go of it and defeats Shego by doing a jump kick that screws with the laws of physics. All thanks to a lesson about cooking where Ron says to her how she shouldn't fear the mixer but instead be one with it.
In The Magic School Bus, usually the dangerous situation is the lecture, or an extension of it, and the resolution always conveniently requires them to recap everything they've learned that day. Arguably justified as intentional on Ms. Frizzle's part as an aspect of her teaching style.
Normally subverted in Mighty Max whenever Max comes up with a clever plan to save the day. It's usually not until after the villain is defeated that Max gives the Chekhov's Lecture, either to the other characters or directly to the audience in the Edutainment sections at the end of each episode.
Referenced when a tipped salt silo from the local cracker factory melts all the snow surrounding the school and Martin tastes it and declares that it melted with "a little help from our friend Sodium Chloride!" He then gets punched in the gut by Nelson.
Another episode has Bart rush out of a class on Roman numerals to steal the town's lemon tree back from Shelbyville. Later on in the same episode he ends up in a room with a choice of doors labelled I-X and a piece of paper that claims that the seventh door is the exit and all the others contain man eating tigers. In a subversion, he doesn't even remember the class but makes the right choice anyway thanks to his knowledge of Rocky films. And in case you're wondering, the film in question Bart comes up with? Rocky VII:Adrian's Revenge.
While needing to prevent a meltdown, Homer tried to remember what he learned about it. It turns out Hpmer wasn't paying attention to the lessons because he was focused on trying to solve a rubix cube. Back in presente time, Homer blamed the still unsolved cube.
The Phantom of Flying Rhino Junior High frequently transforms the school into a death trap based on whatever lecture (or sometimes just topic of discussion in general) the children were having that day. This naturally leads to the students who were paying attention being the ones to get everyone out of trouble.
Zig-Zagged in Winx Club: Most of the time class lessons seen on the show are not immediately applied, usually because they're basic spells or magical theory. However, a few lessons, like the Plasma Sphere for Tecna and convergence magic for the whole group, are taught and then used that episode or a few episodes later.
Total Drama World Tour has Sierra mentioning that Cody's birthday is April 1 during the first episode. In Aww, Drumheller, she makes a cake to celebrate his birthday, which both warms him up to her (because last year his birthday was ignored) and also got her kicked off when the "candles" made the plane explode.
Parodied in Megas XLR, when Coop has sudden flashback to his high school science teacher scolding him for not paying attention and saying that one day he might need her lesson. She was right, as what she was talking about happens to be contain information about the bad guys of the week main super weapon -and Coop really doesn't remember them.
Teacher:One day you'll need to know what a quantum singularity is, and then you'll be sorry!
In one episode of The Mummy animated series, Alex manages to avoid being crushed by falling ruins, commenting on his recent geometry lesson really came in handy.
Inversion: Josh is required to write an essay on the Cold War with a fresh angle. A mission he goes on later that day requires him to go through escape tunnels in Washington D.C. (something vaguely mentioned in the lecture), and he uses that knowledge to get an A+ on his essay.
Max: How come we never have a mission to some place I'm studying? Like the Yukon.
Rachel: Now wouldn't that be convenient.
In the Avatar: The Last Airbender episode "Bitter Work," Iroh teaches Zuko all about the principles of lightning bending. These same principles are later applied when Zuko deflects Ozai's lightning during his Heel-Face Turn, and later in the Grand Finale when Aang does the exact same thing. Incidentally, it was Zuko himself who taught this technique to Aang, figuring that one day it would come back to save his skin. Unlike most other examples, this one is very justified: Azula was hunting Zuko and Iroh at the time, and she is a famous lightning user. Iroh was merely teaching Zuko how to beat a specific, very strong opponent.
Subverted in SpongeBob SquarePants: Spongebob's boating class goes on a field trip to a famous boat, where Spongebob annoys everyone (Mrs. Puff in particular) by rattling off useless trivia. The boat then appears to have activated and is barreling towards town, so Spongebob is called on to save the town. Nope, the boat was being hauled by a smaller tug, and Spongebob's contribution to the whole mess was 1) start the disaster in the first place, and 2) crash the boat into a building.