But once you have created an obstacle how would you go about creating a solution that fits withthe environment with the game?
I may suggest thinking about objects and items that may be found in the enviroment. Place those all around - in your imagination, or make a list on paper. More the better. For example, if your story takes place in the modern apartment, think of all kind of things that people keep in their home.
When you have that list, put yourself on your character's place and seek for various variants of solving the puzzle.
As a slightly different approach, think of solution as a number of functions that the sought combination of items must possess. For example, if there's a locked door, that required item must be able to fit into keyhole and rotate the mechanism - OR be able to remove the door from the hinges (if you like the puzzle be solved that way). Find all the suitable kinds of items in your game's world.
Pick out different groups of items that may be useful. When you have some variants, choose depending on game's mood and genre. For example, if it is a pure comedy game, then take most crazy and eccentric one; if your game is a serious one, then take a reasonable solution.
Also, always keep in mind character's capabilites, skills and knowledge. If the found solution requires technical skills you character do not possess, then better find another one, or make a technically skilled NPC help your character.