Best tire forward
I've had to explain this a few time to novice cyclists, and it's worth reiterating here. Essentially, always put your best tire in front.
This isn't always obvious to people. It wasn't obvious to me either, until I thought about it in more depth, and it was explained to me by more experienced cyclists.
If you start with a brand-new bike, or a brand-new pair of tires (let's assume they're absolutely identical) in time the rear tire is guaranteed to wear out sooner, up to 2x faster than the front tire. Why is that? A few reasons.
The rear wheel is the drive wheel. The same thing happens in cars - front-wheel drive cars will wear out the front axle tires first, while rear-wheel drive cars... you get the picture.
To compound the issue, there's usually more weight on the rear wheel on account of your fat ass grinding it into the ground.
The rear wheel also tends to break traction in loose terrain or under heavy torque. Think what happens to your car when you chirp the tires (or do a burnout if you're a baller).
Finally, the rear wheel is also prone to locking up, sometimes even under moderate breaking if the brakes overcome the friction of the rubber on whatever surface you're riding on. On gravel, for example, this happens often.
You might assume that, since the rear tire is on the drive wheel, it should always be in better shape than the front, or else you won't have enough traction, or you'll crash. Well, not quite.
What it boils down to is that it's a lot safer and easier to control a sliding back wheel than a front one. If your front washes out, in many cases that is irrecoverable and potentially comes with baggage (crash + devastating consequences).
Sure, your rear could wash out severely, but usually you can feel that before it gets out of hand and can safely re-establish control. A front wheel wash-out gives very little warning.
Remember what I said about weight distribution? That plays a big role in how recoverable a wash-out can be. Rear tire has more weight on it, which means better traction even with less tread. Front tire (unless under hard braking, but you wouldn't be doing that in corners anyway) is relatively underloaded making it "floaty" compared to the rear.
Weight-over-axle is a good indicator of how much feedback you'll receive when a slide is about to happen. In fact, once you become familiar with your rear tire, you'll be able to do quite a lot of tiny power slides around corners, with high confidence.
Add all this together, and you'll understand why the front tire tread matters more than the rear.
So how can you use this information when replacing your tires?
Well, my personal philosophy is that I don't usually need to replace both tires when the rear wears out. If you can't tell visually, or feel it riding, most tires have wear indicators. Provided the front tire still has enough life in it based on these indicators, I would simply move the (old) front tire to the rear, and put a brand new tire on the front.
Alternatively, buy a brand-new pair and replace both old tires. Chuck the old rear tire, but keep the old front tire as a spare.
But whatever you do, always aim to have the tire with the best traction / tread in front.