So just what is the environment of the story. The most evident part is the setting, the places your protagonist inhabits or visits. The home, the work space, things like this. Environment is more. No one exists in a vacuum, even those on a space ship have an environment. A second part of a protagonist's environment is the social or cultural area of life. Big city, small town, a foreign country, a particular social group like a social class, wealth, poverty, educational status, job choice, all of these make up part of the environment for the characters in the story. Often one or more of the characters moves from one environment to another. the city slicker on a farm or a ranch, the patient in a hospital, these are the sort of things that make for a dynamic to the story.
How can the environment be used when writing. The setting can be used to set the mood of a story. Think of Gothic novels and the spooky house, or a hospital in medical stories, especially those of suspense, the seashore in a light hearted romance. By choosing bits of a setting to emphasize the mood a writer wants to infuse their story through and the setting becomes an important part of the story.
The social environment can add depth to a story. Rich versus poor, rebel against establishment. These things do play a role often in the characteristics and motives of the protagonists.
There is another way. Suppose your character just loves their entire environment. There's no real story there. Maybe some scenes but there's no conflict. A protagonist can be dissatisfied with his environment all or part of the time. This is how stories are built. Suppose there is a change in the character's environment. In Murder and Mint Tea, the protagonist's son finds her a tenant who changes the dynamics of a neighborhood. This is a devise I've often used. Perhaps the protagonist experiences a change in their environment. In my latest, the Warrior of Bast, the heroine is sent into another environment and must deal with the changes.
Perhaps a stranger comes into the protagonist's environment and makes changes. There are many ways to use the environment in developing characters. Just let your imagination roll and add changes in the environment and see what develops.