The term the truth
is here shorthand for the entirety of the gospel, that is, the glorious message of Jesus Christ having come once into this world, atoning for sin (1 Peter 1:18–19) to obtain an eternal inheritance for God’s own, and the message of our being born again to a living hope (1 Peter 1:3) and now looking forward to Christ’s second coming when saints will receive the fullness of this inheritance (1 Peter 1:5, 1 Peter 1:13).
Peter's readers have purified themselves by [their] obedience
to this truth. In his mind, Peter envisions his readers having already begun to adapt their manner of living (1 Peter 4:3) to the new reality that has come to them with the truth
they heard, and so they have purified [their] souls
in preparation for a particular religious activity. There was specific action they performed that resulted in their now being pure. This parallels the instruction Moses gave Israel at Mount Sinai when he told them to do a particular action that would result in their being prepared to meet God (Exodus 19:10). It also parallels what Israel had to do to prepare for crossing the Jordan (Joshua 3:5) and bringing the ark to Jerusalem (1 Chronicles 15:12). Impure people are able to purify themselves because God through faith has cleansed his own (Acts 15:9). As a result of his (renewing) work, people place themselves under the Word of God in grateful obedience.
22 Having purified your souls by your obedience to the truth for a sincere brotherly love, love one another earnestly from a pure heart,