How Ant-Man actually escaped the quantum realm is a question which is running inside everyone's mind. With over 289 million views in 24 hours, Marvel's Avengers: Endgame has broken the single day trailer viewing record. The very first trailer revealed all those Avengers who survived Thanos' Decimation. At the same time, it featured Scott Lang/Ant-Man, and now fans are thinking that he is the key to save the Universe with the help of Captain America.
It was shown in Ant-Man and the Wasp that after coming out of the Quantum Realm, Janet explains to Hank Pym that Quantum Realm has changed her, and she is now more evolved and has gained some new powers. The film also somehow established that Ghost's whole body was altered due to a momentary exposure to quantum energy.
During the end-credit sequence of Ant-Man 2, it was shown that Scott Lang is inside the Quantum Realm when everyone from his team got decimated by Thanos. Scott is now stuck inside the realm and no one knows what a prolonged stay down there will do to him? Will he gain some powers, which somehow help him to travel to different plains just like Dr Steven Strange did in Dr Strange movie?
If he is able to do that, he might come out of the realm.
However, the case is, Endgame trailer does show him, which means that he somehow manages to come out of the quantum realm.
In the Avengers: Endgame trailer, Scott Lang is also shown with his van parked right outside Avengers' headquarters. This is the same van in which Dr Pym built the quantum tunnelling. It means, Scott Lang has brought the way to Quantum Realm to Captain America and Black Widow. What it signifies is that there is something in the realm, which can actually help the Avengers. Maybe a way to use time travel? or, with the help of Shuri — hoping that she is still alive and not dead like her brother —, Captain America or Ant-Man can actually use the Quantum Realm.
It was reported multiple times in the past that time travel can be the key to defeating Thanos. So, with Scott Lang's knowledge of the Quantum Realm, the Avengers can actually use it in the most effective way.