I am going to watch Avengers: Endgame soon but I have not seen Ant-Man and the Wasp and Captain Marvel yet so I wanted to know if I can skip them and still have no issue to understand Avengers: Endgame or not?
Captain Marvel is set before Infinity War and Ant-man and the Wasp is set at the same time, so it's really not that important to watch them. Although, I'd say you have to watch mid-credit scenes of these movies because they play as teasers for Endgame.
You may skip Captain Marvel though if you have background information about that character. However, you won't know the connection between Captain Marvel and Nick Fury, but it's not really important.
Ant-Man and the Wasp is also set before and during Infinity War. The only thing you need to know is the Quantum Realm which plays an important role. However, you can still get an idea about it while watching Endgame.
From Express article,
While both are set before Infinity War, they could contain something of a teaser for what the Avengers’ plan in Endgame will be in the fightback against Thanos.
But ultimately, if fans don’t have time to see either movie before Endgame it isn’t the end of the world.
However, both films’ mid-credits scenes are the only thing that audiences really should watch before the Marvel epic is out this weekend.
I would like to explain these two mid-credits scenes in addition to AJ's answer.
Ant-Man and the Wasp
In a mid-credits scene, Pym, Lang (Ant-man), Hope, and Janet plan to harvest quantum energy to help Ava remain stable. While Lang is in the quantum realm doing this, the other three disintegrate.
Note: You might not know these characters, but actually you just need to know is that Ant-man is been trapped in the quantum realm.
In a mid-credits scene, set in the present day, the activated pager is being monitored by the Avengers when Danvers appears.
That's all you need to know before watching Avengers: Endgame (not counting Infinity War of course).
All you really need to know about Captain Marvel is that she showed up in the 90s, met Fury, and had an adventure. She gave him the pager before leaving for deep space; told him not to use it unless it was an emergency. Oh, and she can shoot mucho powerful energy beams, and fly, and is super strong.
Ant Man? Nothing important other than when we last saw him (in a post credits scene) he got trapped in The Quantum Realm when the people meant to pull him out got snapped out of existence. Theoretically he can't get out on his own, though from Endgame trailers it's obvious that he gets out