When you get a vaccine it injects a controlled amount of the illness into you, so the immune system can build up an immunity. The memory cells come into play when the illness comes back.
Starving yourself will make you lose weight but will also cause bad health. The best diet to lose weight is to drink lots of water and eat fruit. +exercise