This is a pretty complicated puzzle. There are several ways to work out the logic, but you first might want to start by trying to get King Bodd to use the slipper.
Slippers are often used to kill bugs.
So dig out a roach from the roach motel by having Fulbert crawl into it.