is a figure of speech in which someone absent or death or
something non-human is addressed as if it were alive and present
and could reply.
View page
The figure of speech you are referring to is called apostrophe. It involves addressing someone or something that is absent or nonhuman as if it were present and able to respond.