My wife and I had a ACD that broke it's leg and we decided to spend 6K on his surgery (broken in 7 places, pins, plate etc) and he was worth every penny. I've had both knees done on my MinPin due to injuries.
For me, unless it's a decision on a complicated surgery near end of life it's part of what you signed on for when you decided to care for the life of this other animal.
The best advice I have is that if any surgery is needed there are loan services for the procedure with 0% interest for the first year, and very low interest afterwards. These are available through your vet, but not many people know about them as an option. Something to consider.
Lastly, there are people who will foster, and adopt animals that are in need of surgery. Putting down a young dog should be a last, last, last, last, last, last resort.