These are important aspects of many stories and, indeed, literature in general. When we read or hear a story, we expect each and every detail to somehow be linked and anything that is not relevant to be ignored. It's in the very nature of the way imaginative writing is constructed that its events and meanings also are made to work in one particular direction (i.e. all the events are unified). So... the opening chapter of a novel will have meaning of its own - but this meaning will also be a small part of the whole story and so will, in some way, be contributing to the overall story and its themes.

Inexperienced writers often struggle to maintain the required sense of unity and coherence in their writing, introducing elements of description, plot events and dialogue, for example, that have no connection whatsoever with any central theme or plot requirement. Writing, especially short story writing of the kind you'll do at school, is vastly more effective if it has a single theme working through it from beginning to end. This means you should avoid 'dead ends' - in fact, anything at all that has no clear link with the overall theme of the story.

In a similar way, each line and each image of a poem or play will be contributing in some way to its overall meaning. Thus, if you decide a line of poetry, for example, has a particular meaning, you can check if you are likely to be correct by showing how that meaning contributes to the overall meaning of the poem. In a play, there might well be sub-plots, but you can be sure that in some way even these minor plots will have a worthwhile link to the overall plot and themes of the play.