First you should remove cover plate from switch, unscrew switch mounting screws,carefully pull switch from box, holding it at the top and bottom. Locate the power source in the switch box. Use a voltage tester or any kind of electrical tester It should be one of the black wires in the switch box,which should be and will be tied to the common screw or black screw on your three way switch. This is your hot common. there should be a total of one three wire with ground, red, black and white, then there should be a two wire with ground, black and white, tie grounds together using a pair of linemans pliers or twist them together and wire nut a ground pigtail on to them and wrap around the green screw on the switch. wire nut both white wires together. The white wires are your nuetrals for the lighting circuit.
You have three wires left in that switch box red black and black. The black wire out of the two wire is your hot common.Which should have been determined with the voltage tester. Strip back wire sheathing approximately one half inch and wrap around the black screw or common screw which will be labeled on the new three way switch. Then take the red wire (traveler)and wrap around screw above the common screw. Then place the last black wire on the remaining screw on the opposite side of switch.Now go to the other switch box and you should have the same wire set up. The black wire out of the two wire is your common to the light, wrap it around black screw, or common screw labeled. Wire nut both white wires together. Take the red wire and wrap it around screw above common screw, and place remaining black wire on screw opposite side. screw in switches and turn power on.
Then check to see if the switches work from each side.Turn one off and go to the other one and see if it turns the fiture on and off vice versa.If both switches don’t work properly you may have one of the travelers mixed try switching the red wire or the black traveler( the one on the side of switch with only one screw).