For example: You plan to not study for a final exam and therefore plan to fail the exam you really didn't succeed at planning, did you? in the end you didn't really plan anything at all making your...
The meaning of the phrase "if you fail to plan you plan to fail" simply means if you do not plan out, it is recipe for failing. It means to plan out before you do something, think it out so to speak.
What this means is if you don't plan for something i.e. 'fail to plan' then you can expect things to go wrong i.e. 'plan to fail'. Quite self explanatory.