During his training as the Ant-Man we can see Scott working on the electronics of his suit, specifically some kind of regulator, much to Hank's dismay, and a dialogue similar to the following ensues:
Scott: You know, I think that regulator is holding me back.
Hank: Hands off that regulator. If you damage this regulator you end up in sub-atomic space... Scott: Ok, well, I'll be careful.
And then nearing the end of the movie he has to disable the regulator to get small enough for intruding and destroying the Yellowjacket, which indeed makes him end up in the quantum realm. His enlargement button doesn't seem to work anymore. But then he remembers Hanks words of warning, grabs some object and puts it into his regulator which causes his enlargement button to work again and embiggens him back into the macro world.
But this scene wasn't really explained that much, or I'm just missing something. What exactly did he do there and does it have something to do with his tampering with the regulator earlier (since his comment to Hank didn't sound like he intended to keep his hands off that thing)? Seeing that it seemed impossible even to Hank that anything could return from the quantum realm, it looked rather easy for Scott to just get back again. So did he figure this out himself or was it afterall not that hard to return from the quantum realm at all?