As far as feeding, clown knife fish are primarily piscavores, and fairly picky eaters. You may want to look for a ready source of feeder guppies or similar. It may possibly take pieces of raw shrimp, krill, etc, but it may also refuse.
A 40g tank is WAY too small though. They can get to sizes over 36" in the wild, and over 24" in aquariums. By the time it reaches 6-7" it will be completely miserable and stressed in so small a tank. IMO, if you intend to keep it (Who wouldn't? They're amazing fish), you may want to look at upgrading to at least a 120g tank, with larger being better.