I am new to this game and I am confused on how the hunger system work

I am new to this game and I am confused on how the hunger system work. And also tips on how to fight zombies effectively

Hunger" status which is shown in side panel is “how full is your stomach”. Just like RL. It says nothing about how many calories you get from the food, that’s “satiety” - estimated parameter (calories/volume) you can check in 'E’at menu.

About fighting the zombies - early game, first order of business, don’t fight them except when you absolutely need to. For those cases when you do need to fight - first, make a cudgel, it is a great early-game weapon. Then upgrade to some sort of reach weapon (most likely spear) ASAP.
Use the terrain - zeds are dumb so you can lead them to bushes, even high grass will make them somewhat slower. Vehicles are also useful, with reach weapon and some skill you can sit inside and kill them as they try to move inside (moving in vehicle generally takes 4x time as moving on flat surface).
Ranged weapons are also good, but firearms are very noisy, and bows/slings require quite a few hits to take out the zombies. Personally, I prefers spears early on.

Another thing I was often forgetting when I only started playing - stamina management. The less you have, the worse and slower you fight and after some point you are so slow you can’t even run away from zeds.

What is the best spear to use early game and how to quickly craft it??

How to unfreeze food??

Fabrication 2: wooden spear, only need a knife and a fire to make.
Fab 3: peasant flail (only a cutting implement requierd), copper spear (copper is kinda rare though), will also need a thing with Hammering 1 - even a stone will do.
Fab 4: steel spear, but for that you’d need full-equipped forge setup so it isn’t quite early game.
There are also knife spear (fab 1) and simple knife spear (fab 0) but they are flimsy so they are not so useful. Still ok though.

As for food, make a fire and stay near it. Or make some food using what you have and a fire, it will obviously be hot when crafted.

The hunger system behaves in a rather odd and erratic way. The difference between stomach fullness and calorie needs has been touched upon above.

Stomach fullness fluctuates wildly, so immediately after you’ve eaten or drunk something you tend to remove the “hunger”, but it returns shortly if what you ingested wasn’t filling (like fluids). In addition to that, it can go from peckish to very hungry and back without any externally visible rhyme or reason, which can be handled when you’re doing short duration activities (like walking), but gets rather weird when crafting if you happen to end the crafting on a hunger spike when you’re not actually hungry, and intend to go on to craft another item.
In addition to that, the normal state (i.e. the one you spend the most time in) seems to be “peckish”, and for some weird reason the “hungry” state is entered only for overweight characters, while normal weight ones go directly from peckish to the alarming sounding “very hungry”.
Under normal circumstances you should eat only when very hungry (in particular when overweight, as waiting helps to reduce weight to a healthy level). When you get the message that you don’t get enough calories, though, you ought to eat whenever you’re not full, and go for calorie dense food (calorie dense food and eating only when very hungry didn’t help my character, anyway, although I hadn’t yet settled on my current diet that results in normal weight most of the time with occasional temporary trips into overweight).

It is indeed extremely complicated. I’m still not sure if the interface actually gives you much useful information yet. The satiety bar on the consume list is something I only wish I knew how it worked. Why does a single thing of beef jerky spontaneously full or engorge my character from a single bite? No idea. Jerky is like the least filling thing ever in real life, that zombie pocket jerky shouldn’t cause my stomach to detonate. Why does it take 10+ cooked meat with the same calorie and satiety bar to move a hunger state? Why is water so filling? I can down a 4L jug of water in one go in real life when super thirsty while hydrating in cataclysm takes technique and sometimes an afternoon of patience. It definitely needs some user friendliness, it’s quite the arcane system.

It’s a hard thing to emulate given people can range so dramatically in size but I think leaning towards generous would be better than tighter to emulate that. Being a 6’5 behemoth I’m sure my real life stomach capacity experience is quite different than someone 5’ but my character is also 6’5 so a glass of water shouldn’t floor him.

Tip for fighting. Guns are the most dangerous thing in the game (both in your hands and in a NPC hands). They will take care of anything and everything unless you use a handgun against a beefy and armoured opponent. Just make sure you have enough ammunition to shoot all of the critters attracted to the noise or you REALLY need to know what you are doing. It should also be noted that there are some creatures in the game that are very difficult to take care of no matter what you really do or how strong you are (their difficulty ranges from suicidal to fatally dangerous).

Oh ya combat tips. Take a pace backwards whenever grabbed, don’t want to fight grabbed as multiple grabs quickly turn into a death sentence. Beware small opponents, a zombie child is more dangerous than 100 regular zombies. A wasp is flying godmode death but can kill entire hordes by itself so a useful if risky tool if found near a town as it will absolutely solo clear a city unless the random rolls go severely against it.

Stab stab backstep, stab stab backstep is the tempo for most combat. Slow weapons or especially quick ones can change that up but in general that’s always been the cataclysm battle tempo to avoid injury from slow zombies. Just watch your exaustion. If you lose two bars and aren’t almost done taking a breather is the safe choice. Once you are slower than the zombies you are dead. Injuries also slow you down so armour is a biggy.

MOST IMPORTANT THING

Encumbrance, keep it at or bellow 30-40 per location if you can for fighting. Drop your backpack as encumbrance is the silent death sentence in the game. Hitting the + key when you put something new on to make sure it’s layered right. Further to the bottom is outer. It’s the order equipment gets damaged and blocks damage and also effects encumbrance a lot if layering is wrong. Extra reason to drop a backpack as it will always be one of if not the most outer piece of equipment and will both inhibit you while also dropping all your loot when it inevitably tears open as a primary target for damage taken.