Atletico was banned from making transfers over the summer, which kept the move on hold.
The two clubs spent the entire transfer window trying to come up with an agreement that would suit all parties, but hit several impasses.
Brazil-born Costa joined Chelsea from Atletico for a reported £32m three years ago.
It was reported early last summer that Chelsea's coach Antonio Conte told Costa he was no longer part of the English club's plans for the future and should seek another team.
Atletico said the 28-year-old Brazil-born Spain worldwide, who left the club to join Chelsea in 2014, would have a medical in the next few days before completing the move in the New Year.
"The transfer will be subject to the agreement of personal terms and a medical".
Costa will head back to his former club for a reported £53m after both clubs reached an understanding.
Atletico Madrid is serving a transfer ban so Diego Costa can not play to the Spanish team until January.
Luiz missed Wednesday night's 5-1 Carabao Cup win over Nottingham Forest and will also be ineligible for the Premier League clashes with Stoke and, crucially, Manchester City.
At the time Costa seemed on the verge of signing a lucrative deal with Chinese Super League club Tianjin Quanjian.
The France star's dazzling displays earned him third place behind Cristiano Ronaldo and Lionel Messi in the Ballon d'Or and Best FIFA Men's Player standings in 2016.
Liam is ESPN FC's Chelsea correspondent.
- Veep: Julia Louis-Dreyfus Makes History at Emmys
- Trump tells UN ´sovereign nations´ basis of world order
- Trump, Pence and Palin campaign for senate candidates: will it help?
- Germany's big parties suffer small drop in support
- Best Features of iOS 11
- Here's how Hurricane Jose could affect NYC
- Ryanair Pilots Could Cause Even More Disruption at the Airline
- Ryanair cancels hundreds of flights, sparking outrage from customers
- Interior Dept recommends reducing Bears Ears, other protected land
- Jennifer Lawrence's mother! Is Pissing Off Audiences