Having done this job in both politics and business there are 3 things needed, beyond your own capacity and judgement, to be an effective Chief of Staff. You can determine if they have been present in the relationship between Kelly and Trump.
1. Mutual Respect: This role is an extension of the authority of the leader, if the leader has little respect for the role or the incumbent, others treat the role with the same level of respect. Eventually, the position becomes untenable as without that implied authority the role is bypassed by subordinates, and undermined by the contradictory actions of the leader.
2. The Fine Line: You serve at the pleasure of the Leader but you are a failure if you always agree. Leaders often need to be saved from themselves. If Leaders can't tolerate a contradictory opinion without damaging the relationship then they shouldn't be leaders. The fact is many cant.
3. A Leader who wants a Chief of Staff: Some leaders like the idea of having one but cant bring themselves to get out of the weeds and let the Chief of Staff deal with it. This is trust. If the Leader fails to back the Chief of Staff, and second guesses their decisions on minor issues, even when they think they are wrong, the delicate fabric of this relationship tears.
Like "The Hand of the King" this is a relationship which can be incredibly productive if everything above is present, but you are very likely to lose your head if it is not.