You have to kill David Hasselhof.
But first you need to get out of the castle. Use the spellbook to see what needs to be done. So you need a magic stone. The door on the right is locked. But on the floor is one board without nails. Use the board to lift it and take the KEY from under it.Pull the lever and the room starts shaking. Walk to the left and while the floor is still moving, pull the cord. You’ll then hear something from the next room.
Use the key on the door on the right and enter the next room. In the wall is a KEY. Pick it up and use it on the chest to unlock it and get the magic STONE out. Walk back to the left and use the magic stone on the spellbook to open the portal.
Walk to the right until you reach the portal. First pick up a FLOWER from the field and then walk through to the portal to the right. In the center of the path you can see a sword but it’s too far to reach it. Use the flower on the sword to magically grab the SWORD and then use the sword on David Hasselhof on the right. The devil is defeated.
Game source: A copy of the game was found here on the internet.