Influence/Inspiration vs Plagiarism

Many people would say art builds on art, yet I find it difficult for me whenever I see a verse in a song or an excerpt/snippet someone says in real life from like a podcast to use it as like a reference or homage rather than stealing their work. Storytellers like McCarthy put certain lines from other authors, such as William Wordsworth in Blood Meridian, and use it as a homage, though I, for example, see something like Matt & Shane’s Secret Podcast, and at some of the conversations or phrases they use, and think “that’s funny I wanna use it for my show, I like their dynamic and conversations and think it’d be funny in either conversation or visually in the show.” Same thing with musicians, I’ll see a verse I love and think that’d fit in with my story/this song is inspiring to me. In some sense I notice that what heavily inspires my writing and aspiration to be a storyteller is the lives and experiences of other people, and in some way make a story seeming like a documentary and real life. How do yall go about in writing a story and having inspiration play a role in them? I’d love to hear yalls experience and advice!