The mood you are in when you trip ("set" or "mindset"), and the environment in which you trip ("setting") are two very influential factors.
From The Psychedelic Experience by Timothy Leary: Here's what Tim says about Set and Setting.
The Shroomery's Take:
Set is state of mind or mindset. Setting is the environment one is in and the company one keeps.
Set and setting are key whether one is tripping or not.
Not only is your current mindset directly preceeding tripping important, your mindset of the week, month, year, lifetime all plays a part in your trip. if you are feeling down, or something that you cant get your mind off of wont leave you alone, its nicer to just wait until you are ready. anything youve been thinking about lately is likely to come up while your tripping, this can trigger a chain reaction of intense emotions that may make you upset, spinning your trip off into a part of your mind you might find frightening or depressing. just keep in mind, the best thing you can do is be happy with what your feeling, at least your addressing the problems you have.
A positive mindset and a safe setting is what you want