As a precaution, always take photos of your wiring before replacing anything.
And when replacing 3-way switches, do 1 switch until it's right, and then do next switch.
That's for people who read this later.
Now let's get your wiring project finished.Separate all the wires inside both boxes so you can test
Is there a bare ground wire inside the box?
Are the boxes metal?
More later if you do not have a grounded box***We are going to find the Hot wire from breaker box
Use ordinary tester.
Tape tester leads to wood sticks so hands are away from power
Turn on the power.
All your wires are separated and you do not have a metal screwdriver between your teeth.
You are standing on a dry indoor surface and are not touching anything metal
Power is ON
Test each wire to bare ground wire -or- to metal box
You are testing all 6 wires >> 3 wires for Switch 1 and 3 wires for Switch 2
One-and-only-one of the 6 wires will light up the tester
When tester lights up, that is the Hot wire from breaker.
Let's assume you can identify hot wire from breaker box (more later if needed)**
The hot wire from breaker box connects to the dark-colored screw on the new 3-way switch.
Look at your new 3-way switch >>> it has 1 dark screw and 2 brass-colored screws.
The Hot wire from breaker box connects to dark screw.
The other two wires connect to the two brass-colored screws in any order.
You connected these 3 wires with the power turned OFF
Now we have Switch 1 complete.
The other switch, Switch 2 is incomplete.
Three wires at Wwitch 2 are still separated so you can test.
Turn the power back on
We want to test the other three wires
Let's say Switch 1 is in UP position
Test three wires to bare ground or to metal box
Find which wire is HOT at Switch 2 location
Let's assume you can discover the Hot wire >>> mark this wire and it will connect to a brass-colored screw on Switch 2
Now let's move Switch 1 to the DOWN position
We changed the position of Switch 1 to DOWN, but we're still testing the wires at Switch 2 location
Re-test the remaining two wires at Switch 2 to see which is HOT
The remaining 2 wires >>> one of these wires will test Hot >> that wire goes to the other brass screw on Switch 2
So now you know both wires that connect to brass-colored screws on Switch 2
The remaining wire at Switch 2 connects to the dark-colored screw.
Whew, problem solved, time for a beer.
**But wait, how can you test for HOT if you don't have a ground wire -and- what if metal box was not grounded?
Hopefully you will have other wires covered with a wire nut or tape that are shoved to back of the box >>> you will have to pull those wire out. These will be the Neutral wires. Test your wires to the neutral just as if they were the ground wire. And then use same testing steps above.
Now it's time for a beer (or more depending on when guest are arriving)
Please reply back if you run into a snag.