Is Belief Alone The Answer?

Is belief alone the answer?, and does God still listen to our prayers if we are not in a state of grace?