Dealing with a Will-o'-Wisp in Sonic and the Black Knight is straightforward: you defeat it.
Keep your attacks focused and don't let it drift out of reach. Stay on the offensive, and the wisp won't be a problem for long.