Mind

Does happiness depend on the perfect conditions arising in our materialistic realities or does it depend on the perfect conditions arising in our psychological realities (for me it’s the later and not the former).

Both, to be happy in reality is to be more so happy in a dreamworld, your subconscious would pick up on it.

I personally don’t distinguish between the two worlds but that then depends on how we define happiness.

But it was you yourself or a part of you which manufactured that dream.
is it really any different from our waking lives? Is happiness a continual ongoing thing or is it moments of flow and moments of ebbing?
Perhaps you can see those flashes of happiness and bliss as a promise of what will come or what has the possibility of becoming.
Is the cup of your dream half full or is it half empty?

Happiness is a feeling; dream happiness that is felt is the same as waking happiness that is felt in that they both end when other emotions (disappointment, anger, fear, despondency) become stronger in that present moment.

Allow me to shake your hand, Sir.

I think that it can also be thought of as a state of mind.

The simple solution as recommended by the majority is just believe in a God and all will be well. If you are not game for a theistic solutions there are many effective self-development programs from the Eastern spirituality and religions.

Meditation will help but by itself is not necessary effectively for every one as humans come in such a great varieties.

The human brain is not a computer, but if we view it analogically like a computer with various modular sub-functions that are linked together, such an approach will facilitate one to manage [modulate] the functions of one mind including managing bad painful ugly thoughts.
For example in Buddhism, the mind is describe as having different compartments and sub-compartments or doors and the believer use effort to manage these compartments to manage ugly thoughts that results in unnecessary sufferings [dukkha].
From the above basis, one can make the attempt to train and rewire the brain for optimal performance.

In addition the self comes in many layers, e.g. Freud’s Id, Ego & Superego. There are many other categorization of the human self and selves, e.g. the ‘I’ that think, etc… One approach is to identify the highest level of the self as a CEO over all the other selves within one’s brain and mind. If one can develop the skills and strategic management of the CEO-self, then one CEO-self would be in a position to manage the other individual selves like a team-leader or CEO of an organization.
In this case, one CEO-self must manage those selves that produce negative thoughts like how a CEO will manage those delinquent senior managers within the organization.

There are many strategies and self-development programs to develop the CEO-self and the many other selves within one’s brain and mind out there.

Here is one [psychological & mindfulness perspective] which may be useful.

The person him/herself should not give up but must do a lot of exploring to the limit and find out what is most effective to suit their existing profile.