From Writers Helping Writers:
Successful stories are driven by authentic and interesting characters, so it’s important to craft them carefully. But characters don’t usually exist in a vacuum; throughout the course of your story, they’ll live, work, play, and fight with other cast members. Some of those relationships are positive and supportive, pushing the protagonist to positive growth and helping them achieve their goals. Other relationships do exactly the opposite—derailing your character’s confidence and self-worth—or they cause friction and conflict that leads to fallout and disruption. Many relationships hover somewhere in the middle. A balanced story will require a mix of these dynamics.
. . . .
Up to sixty percent of children construct an imaginary friend, either by assigning a personality and attributes to a stationary object (like a stuffed animal, doll, or action figure) or by creating an invisible one from the fabric of their imagination, so this can be a good element to being into your story. The child’s behavior and relationship dynamics between the character and this imaginary other is different in each case. A tangible object friend tends to become something they care for and protect (a parental or caregiving relationship) while an invisible friend is a companion the child treats as an equal. This latter type can be a person, animal, or something else the child dreams up. Imaginary friends are a healthy source of entertainment, friendship, support, and will allow your child character to explore ideas, gain confidence and competency, and practice social interactions in a safe way.
. . . .
Conflicting Desires that Can Impair the Relationship
In this case, the relationship is one-sided and the child’s desires are being acted out, but even these can conflict. An over-active imagination might lead to:
The imaginary friend’s personality taking over (being disruptive, refusing to do as they are told, etc.), which causes the child to get angry because they aren’t in the mood for this
The imaginary friend “hiding” or showing up late, when the family is going somewhere, causing delays that or problems the child will get in trouble over
Link to the rest at Writers Helping Writers