You don't need to wash jeans as often as some of your other clothes, but when you do, a little vinegar can help keep them the right shade of blue.
One Good Thing By Jillee offers up this tip to prepare your jeans for a long lifespan. On your first laundry load with the new pants, add one cup of distilled white vinegar to your washing machine, and let it mix in well before adding the jeans. The vinegar helps set the dye, which is most vulnerable during that first wash cycle. She also suggests using vinegar in every other wash cycle from that point forward, but the first one is really the most critical.
Be sure to check out the source link for some more tips to preserve your pants.
How To Make Your Jeans Last Longer [One Good Thing By Jillee]