The technique that I believe you are referring to is self-insertion:
a literary device in which an author character who is the real author of a work of fiction appears as a character within that fiction, either overtly or in disguise
But if the character is actively seeking help from the author as the work is being written, another possible word or phrase you might want to use is breaking the fourth wall or meta-reference.
Meta-reference, a meta-fiction technique, is a situation in a work of
fiction whereby fictional characters display an awareness that they
are in such a work, such as a film, television show or book. ... It is also sometimes known as "Breaking the Fourth Wall", in reference to the theatrical tradition of playing as if there were no audience, as if a wall existed between them and the actors.