how do we know about existence of all these different galaxies,stars and planets iif they are so far away?

Well, all the stars you see with the naked eye are in our milky way galaxy, and with telescopes, we can see many, many distant galaxies. Using our knowledge of physics, we can “sense” planets outside our solar system by seeing how they affect the star they orbit. We cannot see or sense planets outside the milky way.