Please read Psalm 109 (31 verses)
The psalmist is seeking the vindication of God against those who are hurtfully speaking against him. These enemies are spreading falsehoods, rumours and accusations against the psalmist who is a man of praying words and not words such as these. These people repay evil for good works and hatred for friendship. The writer is distressed about this situation and the injustice that is being meted out against him.
The psalmist prepares a list of devices against the enemies that he wants God to carry out in his name. He asks for someone evil to rise up against the enemy and teach them a lesson, that the name of God and justice will be made righteous in the eyes of onlookers. He is concerned about his own justice and also how God appears to outsiders looking into this scenario.
There is a long list of retributions against the wicked, and it seems to contradict the command to love enemies and pray for them. The issues here is a justice issue and the fact that the enemies are destroying the life and work of the psalmist and they must be stopped. Only God can do this as only He is the searcher of the motivations of the human heart. The psalmist wants us to see that God cares for His people and will not permit them to be bullied and bludgeoned forever. There is justice and the Lord will administer it in His own time and in His own way.
The psalmist casts all His concern for justice and fairness on the Lord and prays for the situation and the people involved. They are for war, but he is for peace. They are for evil, he is for the good. God will do all things well.