Okay, a disclaimer to keep the fiction police happy, not every character can be comfortable with or be in contact with poetry. Yet, perhaps the character is a frustrated poet or had to write a poem in one of his or her high school or college classes. Feasible, you bet. If so, (and I bless my hardworking English teacher daily) you can incorporate the created poem into your story.
What if your character didn't attend the conventional school? Then there are several avenues in widely diverse genres to have the thematic poem disclosed to your fiction readers.
Captain Kirk on Star Trek, or your equivalent, can uncover it in a galactic cave. Maybe it just shows up as a hologram from the past. Perhaps it's a clue to a distant surviving culture that commands billions of gallons of fracking natural gas and is ready to crash the world's economy or, if you understand the poem's meaning, fill your vehicle's, and no one else's, gas tank cheap. If that's not compelling, then it could be part of a regular, old-fashioned mystery. Stranger things happen.
Your fictional romantic time traveler can find it tucked in an old trunk Shakespeare discarded on the way to Stratford-on-Avon. If you have a midsummer's night's dream not an accident, there can be a Puck you can count on. Your poem's discovery can be the "to be" of the be or not to be uttered by your Hamlet wannabe.
If your character is a historic saint, say, take mine, he lived as a Gaelic monk in the sixth century. No, he wasn't St. Patrick who lived a century earlier. Who knows how much poetry my historic saint buried in the Irish caves escaping the Huns? Sorry, they were later and probably on a different continent. Maybe it was Finn McCool who performed the historic deed to save the magic poetic scroll my saint scribbled on whatever fast food scraps of paper then existed? I love that legendary McCool guy. He's such a 21st Century Disney character. Whoops, Disney hasn't put him on celluloid yet next to that famous Tinkerbelle. But okay, thinking harder, it was the thugs from Denmark who threatened my saint. Oh, those Danes, still around centuries later to cause Will Shakespeare dramatic trouble.
If we consider more modern times, didn't Agatha Christie conjure up mystical powers in several of her fictional stories. Perhaps a pale horse chased by Miss Marple? Or didn't Herucle Periot brave the Egyptian sun to find a poem in the tombs, or on an ancient scroll that would serve your purpose? You do the research. I'm just generating ideas.
If there's no historical villain or convenient sleuth, create your own. Remember, you're writing fiction.
Just ponder what the following poem means or says to you or us as readers. It's taken from Chapter Thirty-Four of my novel, A Body To Bones, First Skeleton Series Mystery, said to be written by a small town newspaper publisher. That he might do that would make sense, right? If I'm not the National Poet so be it, I'm, as you will be, hiding behind a created character. The question is does it impart meaning that is understood by the reader, if not critically acclaimed?