provided by various sources in the U.S. government (e.g. CIA, NSA, Army and Navy Intelligence...etc.) warning him that China was freaking out about Trump and that he might use a military strike to serve as a means of staying in power...(whether that was ever going to work, we've seen leaders before gain public support in times of international conflict...Trump may have been envisioning a "Gulf of Tonkin" type scheme...who knows...)...conferred with those sources...and others in the military and very likely in the Congressional oversight committees...and made the call to his peer in China to calm them down and avoid rash actions by them.
This was a military action fear that China had wrt Trump...and having the highest ranking military officer in the U.S. call them was an understandable option...Milley certainly couldn't use Trump or anyone in his cabinet (e.g. Pompeo)...but this all my conjecture...I'm in no way trying to assert that this is exactly what happened
We'll all learn more about this a things unfold with the release of the book...and, hopefully, public hearings in Congress.