Modernism is a style of writing that showcases characters who are alienated and have difficulty communicating with one another, experimental writing styles, a theme of how industrialization leads to unhappiness and isolation, and using symbolism and setting to represent mood and meaning. All of these features can be found in "The Love Song of J. Alfred Prufrock," which in essence, is a dramatic monologue. The style of a dramatic monologue works well with modernism, because it allows Eliot to showcase "stream-of-consciousness" writing, which is writing that jumps from one topic to the next in seemingly random orders. Because we are getting Prufrock's thought in a monologue, it mimics the way that every person's brain works; when we think, it isn't in any logical sequence, it is random, it jumps from subject to subject, coming back to a main issue that is concerning us. Throughout the poem, Prufrock's monologue centers on his desire to speak his heart to the woman that he knows, but like all thoughts do, his mind wanders away and back to that subject throughout the entire poem. We see his mind through is dramatic monologue, and his mind is one big stream-of-consciousness trip through the many facets that tie everything together in his head.
So, the dramatic monologue style lends itself well to the stream-of-consciousness style of writing, which is a feature of the experimental mode of Modernism. The dramatic monologue also allows us to see how alienated and alone that Prufrock feels; he feels like a "crab," and old man, he feels ostracized and mocked, and we know all of this because Eliot shows his insecure thoughts through the monologue. That alienation and loneliness is another trait of modernism; without the dramatic monologue, we might not know that was how Prufrock was feeling.
Those are just a couple ways in which the dramatic monologue and Modernism fit together--through the theme of isolation, and through the style of experimental stream-of-consciousness writing that Eliot uses. I hope that helps a bit; good luck!