Purpose of .......the Book of Psalms is the longest book in the Bible, with 150 individual psalms. It is also one of the most diverse, since the psalms deal with such subjects as God and His creation, war, worship, wisdom, sin and evil, judgment, justice, and the coming of the Messiah.
The Book of Psalms is a collection of prayers, poems, and hymns that focus the worshiper's thoughts on God in praise and adoration. Parts of this book were used as a hymnal in the worship services of ancient Israel. The musical heritage of the psalms is demonstrated by its title. It comes from a Greek word which means "a song sung to the accompaniment of a musical instrument."
Who wrote.....the brief descriptions that introduce the psalms have David listed as author in 73 instances. David's personality and identity are clearly stamped on many of these psalms. While it is clear that David wrote many of the individual psalms, he is definitely not the author of the entire collection. Two of the psalms (72) and (127) are attributed to Solomon, David's son and successor. Psalm 90 is a prayer assigned to Moses. Another group of 12 psalms (50) and (73—83) is ascribed to the family of Asaph. The sons of Korah wrote 11 psalms (42, 44-49, 84-85,87-88). Psalm 88 is attributed to Heman, while (89) is assigned to Ethan the Israelite. With the exception of Solomon and Moses, all these additional authors were priests or Levies who were responsible for providing music for sanctuary worship during David's reign. Fifty of the psalms designate no specific person as author.
http://www.gotquestions.org/Book-of-Psalms.html
In reality one can find a psalm to deal with most anything in his life,