Complex sentence: Professor McGonagall telling her she had "failed everything", as Hermione is afraid of failure.
Split into simpler sentences: Professor McGonagall telling her she had "failed everything". She is afraid of failure.