Can I lose weight by not eating for several days?
Sure, it is called starving. People generally lose weight when they do that. Also, your metabolism will slow down. Your body will adapt by making it harder for you to lose weight.
There is a concept called intermittent fasting. This is not starving. It is going without food for a period of time that is longer than modern humans typically do. When you do eat though, you are supposed to get complete nutrition.
When you get complete nutrition, you skip out on starvation mode. When you are in a fasted state, your body will marshal it's resources to enable you to hunt. Once the body is accustomed to being rewarded for it's efforts, it will gladly burn fat like crazy during the fast. Reward it by eating good quality food after your fast.
I love intermittent fasting. I feel amazing when fasted, I look and feel good. When I break my fast, everything taste amazing.
Think of the things you eat like the material your body has to work with. Give it a variety of good building blocks. Eating more healthy food will give you better results than simply not eating any junk food.