Fighter
I'll assume heavy armor (chain mail) plus shield for AC 18. No Dex needed, so I'll just put 10's in Dex/Int/Cha, and have 16 Str/Con and 13 Wis. HP is 22. Proficiency in Perception gives a passive perception of 13.
The fighter doesn't see the goblins, so they attack first. They have advantage from being hidden. With a +4 to hit, they have a 57.75% chance of hitting. There's a 92% chance of hitting at least once, and a 42% chance of hitting twice. There's also a 19% chance of landing a crit.
I'll take the two hits and no crit for the first round. Damage is 1d6+2 per arrow shot, for 11 total damage to the fighter. He's down to half health.
The goblins use Nimble Escape to run off and hide. With a +6 stealth vs the fighter's passive perception, 2 of them manage to hide, and 1 fails. That gives the fighter a target, at least.
The fighter runs for the exposed goblin. He also tries to position the tree the goblin was trying to hide behind so that it will provide partial cover against the other two goblins. He'll get a +2 AC for that.
The goblin has a listed AC of 15, but that includes a shield. Since the goblins are using bows, that drops to 13. The fighter has a +5 to hit, so a 2/3 hit chance. We'll give him the first hit here, which does 7.5 average damage against the goblin's 7 HP. 1 dead goblin.
The fighter pauses briefly to recover, using Second Wind for 7.5 HP. He's back up to 19 HP.
The goblins make their second attack. They have advantage, but the fighter now has 20 AC. A 44% hit chance will have 1 goblin hit for 5.5 damage. The fighter drops to 13 HP.
The goblins try to hide again (65% success chance). I tossed a die for the second one, and he failed. The fighter rushes for the exposed goblin again, but misses this time. He uses his second Second Wind for another 7.5 HP, putting him at 21.
The goblin can't get far enough away to feel safe, so he drops the shortbow and pulls out the scimitar and shield. His AC is now a 15. Unfortunately he doesn't have advantage, and, even without the fighter having cover, he misses on his attack.
The other goblin shoots from hiding and hits for another 5.5 damage, dropping the fighter to 16 HP. The goblin hides.
The fighter doesn't care about that one, though. He's just focusing on the one in front of him. Despite the goblin's shield, the fighter still hits, but only does 6 damage — 1 HP short of dead. Frustrating. On the upside, he applies Sap to the goblin, giving it disadvantage on its next attack.
And he lucks out there, because the goblin finally got its nat 20... and a 12. It misses, and the fighter avoids the crit.
The second goblin fires from hiding, but misses for the first time despite advantage. It also fails to hide, with the fighter seeing its movement out of the corner of his eye. However he doesn't have time to pursue that one yet.
The fighter attacks, and — crit! Against the 1 HP the goblin had left. Disappointing achievement. Well, he splatters the goblin against the tree, and then turns to locate the other goblin that was trying to hide. Unfortunately he can't reach the goblin with his movement, so instead finds a tree to hide behind for 3/4 cover.
The goblin doesn't know it's been spotted, so takes the attack. The arrow sticks in the tree, and the goblin rushes to find another hiding spot.
There's a bit of cat and mouse for a couple rounds, as the fighter has to use his action to Search, while the goblin fails to hit an AC 23 due to the cover the fighter is using. Eventually the goblin fails to properly hide, giving the fighter the opportunity to rush the creature and finish things off.
The fighter ends with 16 HP, and, taking a short rest after that harrowing attack, recovers his health (1 HD) and Second Wind, and is ready to face future threats.
Monk
I'll give the monk 16 Dex/Wis, 14 Con, 10 Str/Cha, 8 Int. 16 AC, 17 HP. Passive perception is 15.
Unfortunately the goblins still manage the ambush, given a passive stealth of 16. With advantage, they have a 70% chance to hit, so 2 of them land attacks, doing 11 damage. The monk is down to 6 HP. Two of the three goblins then manage to hide.
The monk could run. A double Dash would get him 120' away (outside the normal 80' range of the goblins' shortbows), and he'd have a better than 50% chance of not being hit if he used a large tree for cover. However we're trying to see what he could do in a fight.
He rushes the first goblin, and has a 65% chance to hit. We'll give him the first hit (just like the fighter), and with his 1d8 quarterstaff he's also averaging 7.5 damage. Goblin 1 down.
However he also has more movement, with his 40' speed. He's going to find a large tree to hide behind, and Dodge using his bonus action. He can't afford to take another hit, and the two hidden goblins currently have the advantage.
It's a bit close, but both goblins miss. If the monk hadn't used Dodge, one of them would have hit. The goblins try to hide again, and one succeeds while the other fails. We have a target.
The monk rushes the goblin, strikes... and misses. He now has to choose what to do with his bonus action. He could attack (or FOB) and hope he hits and does enough damage to kill the goblin (33% chance with MA attack, or 66% with FOB). He could disengage and run, but that would leave him back in a bad position of being sniped. Or he could dodge and hope that his defenses hold.
He decides to risk it with FOB. He delivers a roundhouse kick to the head, and hits! Coin toss says... kill! The goblin's neck snaps, and the monk throws himself against the nearby tree, breathing hard. The DP spent wasn't needed, but it was insurance against the dice being against him (which they very well could be).
The remaining goblin screeches angrily as it fires another arrow. It misses, and the goblin hides again.
Unfortunately the monk doesn't have the luxury of charging in now. He's out of DP, so can't negate the advantage of the hidden goblin. And while he has a better chance of spotting the goblin with Search than the fighter, he can't capitalize on that without risking taking an attack from the goblin that he can't afford, since Search uses up his action.
So he tries to counter the goblin at its own game, by hiding until he can spot the goblin failing its own attempt. It becomes a Stealth vs Perception game. This favors the monk, since he has proficiency in Stealth (+5), but the goblin is awful at Perception (-1).
The goblin has a 20% chance of spotting the monk, while the monk has a 45% chance of spotting the goblin. The odds favor the monk, and eventually the goblin slips up. The monk easily has the speed to reach the goblin, and between the staff (with Topple knocking the goblin down) and the followup kick, the goblin is down.
He'll want to use both hit dice during his short rest to recover to full HP and be ready for the next battle.