More than imaginary
The protagonist struggeling with mental problems uses his imagination to get a girl he met in his dream. Together they try to get his life back in order.
It deals with suicidal thoughts throughout so reader discretion is advised.
This is based on a reddit post I saw a few years back which has unfortunately been taken down as far as I know. It is based on the theory of positive constructive daydreaming.