The key to understanding this is reading it in context of Genesis 18:1-19. In v. 1-2 it says that the “Lord” appeared to Abraham. The Bible doesn’t give us any more information about this appearance. This appearance could have been in bodily form (probably not as God does not appear in bodily form in any OT passage that I can remember). Most likely it was a natural appearance like the burning bush. It then goes on to say that Abraham “saw three men standing nearby.” By seeing the men, Abraham see the world of the Lord. Quite often in the OT the Lord is represented by angels, etc. and the character who has seen them says that they have “seen the Lord.” Abraham somehow knew that these men were somehow divine and representing God. We should not make the mistake of calling them angels in the proper sense because they had bodily form and were able to eat and drink (see v. 8). So these men were a representation of the Lord to Abraham, but they were not the Lord in the proper sense.
Now, because they are men, they walk down to Sodom and Gomorrah. They are not privy to the knowledge of God: they are not omniscient (all knowing). The are limited in their knowledge as created beings. Therefore they needed to walk down and see how bad it was.
After the men go away Abraham continues to be in the presence of the Lord. He talks to Him about Sarah and then pleads for the two cities. Again, we don’t know the nature of this presence, but it’s clear that He was there.