When you're working on composites, there are many variables that you need to attend to to make the final result convincing, matching colors being one of the most important. It turns out that Photoshop has a built-in tool to help you do this automatically.
Coming to you from Aaron Nace of Phlearn, this helpful video will show you how to automatically match colors between two images using Photoshop. The tutorial relies on the Match Color feature, which analyzes the statistics of a source image or layer and attempts to use them to match the colors in a destination layer or image. It doesn't always work, but when it does, it can save you a ton of time and eyeballing back and forth. Also note that it only works in RGB mode. If you're looking to match specific colors or an area of the photo, the Match Color feature allows you to select an area of the source and target layers or images to analyze. This can be particularly useful if you're trying to match skin tones, for example. As Nace mentions, be sure to use the "Fade" slider to adjust the strength of the adjustment to help maintain realism.