The environment around, the atmosphere and mood states These things affect your writing. You will write out well when the brain is relax and concentrate.
You need to find the perfect place unto you. Some may prefer to think in a coffee shop. Some may be in the shade at the park. Or maybe it's quiet at night. These are based on personal preference.