The Gospel of Luke (Luke 2:8-20) tells us that an angel of the Lord appeared to the shepherds while they were in the fields watching their flocks at night. The angel brought them "good news of great joy" - the birth of the Messiah, Jesus.
The angel also gave them a specific sign to identify the baby: "This will be a sign to you: You will find a baby wrapped in cloths and lying in a manger."
Immediately after the angel delivered this message, a multitude of angels appeared praising God. Then, when the angels had left them, the shepherds decided to go to Bethlehem to see the thing that had happened, which the Lord had made known to them.
So, in summary, the shepherds knew where to find Jesus because:
* An angel of the Lord specifically told them.
* The angel provided a specific sign: a baby wrapped in cloths and lying in a manger. This sign, though simple, was likely considered unusual enough to help them pinpoint the right baby.
Essentially, they were divinely guided to the location.