there is no magic secret! it is all about how you choose to interpret the color you see—i.e., your personal stylization.
look at this wonderful picture of fuji apples:
(By Scott Bauer, USDA ARS, Public Domain)
the local color of the fuji apples above is red, and they're lit and photographed in a way that makes them appear pretty uniformly red in hue as well. but you can still pick up some small variations in hue, as well as saturation (chroma) and value!
you can go the hyper-realistic route, carefully observing and replicating the colors you see to create a painting of fuji apples that is as close to real life as possible. you can also choose to stylize and interpret the colors through a certain lens, which may help convey a certain mood or just make the image more aesthetically pleasing (humans usually enjoy limited palettes it seems).
there is an infinite number of ways you can do that! which is where the fun of experimenting and developing your own style lies. the important thing you need to remember is that, while i picked those little swatches with the eyedropper tool, you should observe and depict any color in relation to its neighbor and not on its own. is this patch cooler or warmer in hue in relation to its neighbor? is it more or less saturated? is it lighter or darker in color?
once you have analyzed those properties, you can think of how you want to stylize them. would you like to lean the darker shades red? would you like to make one object more saturated than everything else in the picture, to draw the viewer's attention to it? would you like to make all the lighter colors lighter and all the darker colors darker in order to up the contrast of your painting? the possibilities are endless.
here's my little 15 minute study!
i made the background more green in hue because i wanted the apples to stand out more, pushed the highlights away from white and towards light green to make the color scheme more harmonious, and added purple to the shadows because that's what i do. : ) among other things. it has changed both the mood and the lighting of the original photo! and you don't have to follow this algorithm for everything, or indeed anything—you can play around with color any way you want.
you can do this kind of color nudging with color overlays in graphic software too, to a certain extent. for example, if you set a solid yellow layer to 'darken color' over a picture, it will turn all the pixels of that picture that are lighter in value than that particular yellow into that yellow. things like that can make your color palette more cohesive/limited, and doing those adjustments in your head as you paint (as opposed to on a separate layer) can make them look more varied and fun. no shame in color correction, use it! it's a tool just like any traditional glaze is, and if you have a favorite 'glaze', with practice you will figure out what it is you like about it and start incorporating that right at the painting stage.
tl;dr: observe the colors around you in relation to each other, experiment with them, and most importantly paint and practice a lot! thankfully there are no magical secrets, only color theory and practice 💪( ͡° ͜ʖ ͡°)
for color theory reading, i recommend James Gurney's Color and Light! it was recommended to me last year, and introduced me to the gamut map approach, which i hadn't been familiar with before. i've only used it once but it was tremendous fun and taught me a couple new things.
hope this is helpful! happy painting 💜