As I studied this verse I discovered that the Hebrew word for afraid, Yare, has two separate meanings. The first is the negative emotion of fearful…while the second is the positive emotion of reverence and awe for God. So what David is explaining here is that in the time of fear he consciously shifted his mind from one meaning to the other… from dwelling on a negative emotion to focusing on a positive one. So instead of standing on the shifting sands of fear and anxiety David planted his feet firmly and confidently on the solid rock of Christ.