"The Lord is far from the wicked: but he heareth the prayer of the righteous." (Prov 15:29)
"Far from the wicked..." Not his essence or his powerful presence, but with respect to his favor and good will. He does not answer their cries in their desperate circumstances. He does not draw them near nor will he welcome them on the last day, but send them away having not known them. Who are the wicked? Those who are evil, morally wrong, corrupt, hateful, or iniquitous. Those who only know God when it's in their best interest or when the want something from him. Those who place themselves high above others. Those who feel his law does not apply to him. Those who change his laws to meet their "less than" moral values.
Who are the righteous? Those who conduct themselves in a godly manner. Those who are basically good, virtuous, upright or decent. Those are the people he draws near. He sees their pain and hears the cries. He answers their prayers (and remember, sometimes the answer is "no"). He bestows his blessings and favor on them when in need.
This verse does not tell us that he withholds love from the wicked, for he loves us all - each and every one of us - the wicked and the righteous. We are all his children, and he wants us all to come to him, humbled and grateful. Remove any wickedness from your heart. Conduct yourself in a godly manner. Let go of any immoral or corrupt behaviors. Be active in prayer and praise. Be righteous!