On your first guess, just leave them all red. If you get any right, you know for a fact that you have that many red ones. If you don’t, you know for a fact that you don’t have any red ones.
Next, however many you get wrong, replace those with white. For example, if after your first turn, you had 2 right, next turn you should guess 2 red and 2 white.
Keep going like this, trying one color at a time for any you still have wrong. Since there are 6 different colors, you will know the correct colors at least by your 6th turn.
Now you just have to figure out the order. Just use trial and error. Pay attention to how many are right in the right place, and how many are right in the wrong place, and compare those with previous turns. This way you should break the code within 3 or 4 turns of figuring out the colors. You have 10 turns in which to break the code, so you will almost never lose. 🙂 – lazuli_blue