You need to fight magic with magic, and believe; that you have something to help you win; like speaking to snakes or an invisible robe; an army of ants or a deadly joke; the ability to accomplish anything; marry a monster or give up your first son
Some lines in the poem are serious, but most lines take more of a light hearted mood. It says how they are impossible tasks, which is serious, but then gives examples of the extravagant tasks that are most likely silly. All the tasks are a form of imagery because you end up picturing all of them.
When faced with an impossible task, fairytale characters don't really think of the fact that it's impossible, they know it has to get done so they act on it. Unlike our society, where the is doubt and insecurity.