David cried to the Lord in Psalm 28 to be heard, because David did not want to be equated with the wicked. He prayed,
Do not take me away with the wicked
And with the workers of iniquity,
Who speak peace to their neighbors,
But evil is in their hearts.
The wicked spoke peace to their neighbors, yet had evil in the heart. David declared to the Lord that he was not like that. Therefore, David did not want to be taken away with the wicked, as though he was the same as them.
Something happened that made him fear he would be taken away with the wicked. Evidently the Lord heard David’s prayer because he was not taken away with them.
Pray as David did and God shall hear you.