From Tesla:
An average electric vehicle (EV) will need a replacement battery when it has lost 20% of its range. Most users have reported Tesla battery loss at only 5% after 100,000 miles.
Tesla batteries last between 300,000 to 500,000 miles. The average person drives 273 miles a week, so you can expect your Tesla battery to last anywhere from 21 to 35 years, depending on your driving habits.
Point being, Tesla batteries will rarely (if ever) need to be replaced. You’ll probably need to replace your car before you need to replace the battery.