The controversial hitman has reportedly been fined by the club for failing to turn up for pre-season training last month.
In an interview with the Daily Mail, the Spain international criticised his manager Antonio Conte after the Italian allegedly sent him a text message informing him that he was no longer wanted at the club.
Costa added that if he is to leave this summer, he only wants to return to his former club Atletico Madrid, but Barton thinks that the Merseyside outfits should make moves.
"If I'm Liverpool or Everton I'm doing everything I can to sign Diego Costa. I'm coming in now to Chelsea saying 'look, you're clearly prepared to do it having sold [Nemanja] Matic to a title rival in Man United'," Barton told talkSPORT.
"Liverpool are crying out for a forward of Costa's ilk and so are Everton. If they want to get into that top four consistently and do well in the Champions League - Everton in the Europa League - you could do a lot worse than Diego Costa.
"[Costa] knows the model. He's done it consistently over the last few years. If I was Ronald Koeman or Jurgen Klopp I'd be on the phone to Chelsea trying to get that done."
Costa scored 20 Premier League goals to help the Blues win the title last season.