The teams begin a three-match series at Headingley on May 19, the ground where, two years ago, Sri Lanka clinched a dramatic 1-0 win in what was then the second of a two-Test campaign when Anderson was dismissed off the penultimate ball of the match.
"To get within two balls I did feel crushed at the end of it," said Anderson. "It had been a long game and we came so close."
But the damage at Headingley had been done on a fourth day where Sri Lanka captain Angelo Mathews made a superb 160 and, significantly, shared a stand of 149 for the eighth wicket with tailender Rangana Herath.
Cook's tactically naive ploy of feeding Mathews runs in order to get at Herath backfired spectacularly.
The England skipper repeatedly stationed four men on the rope for the first four balls of an over only for Mathews to respond by going on the offensive, with 16 of his eventual 25 fours coming off the last two balls of an over.
But Anderson feels the growing authority Cook has been given by England's Australian coach Trevor Bayliss, who took charge for the team's 2015 Ashes triumph, means there's no danger of his longstanding skipper letting a situation drift again.
"It was gutting really and hopefully we'll not be in that situation again this time," said Anderson, England's all-time most successful Test bowler, with 433 wickets to his credit.
Anderson, 33, said he felt Cook's increasing command had
"I think Cooky's done a fantastic job. Certainly since Trevor's come in he's taken more responsibility," said Anderson, speaking at Lord's on becoming an ambassador for Brut Sport Style.
"He's the guy that people look up to and he's in charge. Obviously Trevor's given him that responsibility so that's been good.
"All the teams I've ever played in it's always been the coach at the forefront, so for the captain to be in charge, from what I hear that's the way the Australians did it all the way through their success.
"But days like that aren't just down to him, you need your bowlers to perform, senior players to step up and actually help out and I think everyone just disappeared then into a hole in the field.
"It was everyone's fault that day. So the way you get rid of situations like that is by the captain learning from those sorts of days and the players have to do that as well.
