Earwig And The Witch by Diana Wynne Jones

An indomitable orphan girl who loves to be in charge is adopted from a children’s home by a strange pair who turn out to be a witch and her companion; rather than being cowed by chores and rules, she quietly learns a little magic and uses her sharp wit, stubbornness and resourcefulness to outmaneuver them, flipping the household roles and discovering how power, independence and an unexpected kind of family can be claimed on her own terms.

Purchase from Bookshop.org