How can you tell the difference between a star-forming region and some other bright spot in the image (like a foreground star)?

How can you tell the difference between a star-forming region and some other bright spot in
the image (like a foreground star)?