You can remember the meaning of 必要 with this easy mnemonic:
Why must (必) some dogs show their love with their slobber? I want (要) a cat that interacts with me only when necessary.
Using mnemonics to remember the meaning of Chinese characters like can have an enormous impact on how long to learn Mandarin it takes.