A couple of characters in the Marvel Cinematic Universe have been recast, including Thanos himself, who wasn’t played by Josh Brolin when he first appeared in The Avengers. The MCU began back in 2008 with Jon Favreau’s Iron Man, and has since produced over 30 films, as well as a selection of Disney+ TV series and original Special Presentations. The MCU's Infinity Saga came to a close with Avengers: Infinity War and Avengers: Endgame, which brought together all the superheroes in the franchise to fight a common enemy: Thanos.
https://screenrant.com/marvel-thanos-recast-after-avengers-josh-brolin-reason/