Red balls are mainly used in Test cricket because they are more durable and can handle the long format of the game, which lasts up to 5 days. The red color also stays visible in daylight for a longer time compared to other colors. Since Test matches are usually played during the day, the red ball works perfectly and helps bowlers get swing and seam movement as it ages.
White balls are used in ODIs because most limited-overs matches are played under floodlights or in day-night conditions. The white ball is easier to see at night, both for players and spectators. However, it gets dirty faster, which is why it’s designed differently and often replaced more frequently. As Sportsplay24 explained, the ball colour choice is mainly about visibility and match duration, not just tradition.