Passage
With the pure thou dost shew thyself pure; and with the perverse thou dost shew thyself contrary.
With the pure thou dost shew thyself pure; and with the perverse thou dost shew thyself contrary.
Psalms 18:24 And Jehovah hath recompensed me according to my righteousness, according to the cleanness of my hands in his sight.
Psalms 18:25 With the gracious thou dost shew thyself gracious; with the upright man thou dost shew thyself upright;
Psalms 18:26 With the pure thou dost shew thyself pure; and with the perverse thou dost shew thyself contrary.
Psalms 18:27 For it is thou that savest the afflicted people; but the haughty eyes wilt thou bring down.
Psalms 18:28 For it is thou that makest my lamp to shine: Jehovah my God enlighteneth my darkness.
The verse centers on "pure", "thou", "dost", "shew", "thyself", and "perverse". It is saying that the verse draws attention to "pure" and "thou", so its meaning should be read from those terms before moving to application.
The nearby context moves from verse 25's "With the gracious thou dost shew thyself..." into verse 27's "For it is thou that savest the...", so "pure" and "thou" belong inside that flow. In Psalms context, the local focus is worship, trust, the LORD's kingship, and covenant mercy.
A plain takeaway is to answer the verse's own emphasis on "pure" and "thou" with trust shaped by these words, not by a vague optimism outside the passage.