Moody coached Sri Lanka to the final of this year's World Cup but turned down an offer of a renewed contract to return home for family reasons.
"It was a very difficult decision to make given the strong relationship that has been built between SLC (Sri Lanka Cricket) and myself. But at this stage in my life it was important that I made a bigger commitment to my family," Moody said in a statement released by SLC.
"However, I will be more than happy to assist in whichever way I possibly can for the continuous success of Sri Lanka Cricket."
Moody had indicated before the World Cup that he was planning to leave Sri Lanka when his contract ended at the tournament but SLC officials had wanted him stay.
"SLC regrets that Tom Moody has to leave our services and respects his decision," the organisation said in a statement.
"SLC is grateful to Tom for his valuable contributions to the success of the national team and SLC during his tenure. We wish him all the success in his future endeavours."
The SLC said assistant coach Trevor Penney, who has a contract until August, would lead the team during their upcoming Bangladesh tour while they searched for a new coach.
Penney has already accepted a deal with Western Australia to continue as Moody's assistant when his contract with Sri Lanka expires.
Moody also played 145 first-class matches for Western Australia and won the national inter-state championship, formerly known as the Sheffield Shield, five times.
He went on to play eight Tests and 76 one-day internationals for Australia and was a member of the 1987 and 1999 squads that won the World Cup before turning his hand to coaching.
"I am extremely proud of my involvement with WA cricket as a player and the success we enjoyed as a team throughout the 1980s and 1990s," Moody said in a statement released by the Western Australia Cricket Association (WACA) on Monday.
"I am looking forward to working with former team mates such as Graeme Wood and Justin Langer, two men I was able to share the thrill of winning Sheffield Shield and domestic one-day titles with."
Moody, 41, began his coaching career with Worcestershire in England before taking over as head coach of Sri Lanka two years ago and is regarded as one the shrewd and clever coach.
"This is one of the most significant appointments that the Association has ever made," WACA chief executive officer Graeme Wood said.
"Tom is a legend of WA cricket and has led the State to domestic first-class and one-day titles. He brings a wealth of coaching experience after his success with Sri Lanka and Worcestershire, and will command instant respect from the squad."