Psalm 119 is the longest Psalm in the book -- 176 verses sorted out into 22 different sections. Each section begins with a letter of the Hebrew alphabet in order. In seminary, they told us this meant it was an "acrostic" Psalm but that fact never came up in discussing its meaning, so I don't know why they told us that.
It's a hymn of praise and thanksgiving for...the law. To us Christians, this might seem a little strange because we are used to a more negative view of what we call "the law." In the gospels, legalist Pharisees try to trick Jesus with questions drawn from the law, and their own hair-splitting over the years has made an already complicated code more or less impossible to understand or to follow. They wield "the law" when they complain about Jesus healing people on the Sabbath, and we come to think of the law the way we think of the main villain's henchman in a movie -- he's not the real baddie, but he's bad enough and we don't like him because of who he works for.
Paul also seems to pit the law against the main component of how he sees the gospel message, the magnificent grace of God lived out and brought through Jesus Christ. Because of the law, we know our selfishness and self-worship is actually sin that separates us from God. The law is the messenger that brings us that information, and while the old saying tells us not to shoot the messenger, it assumes we will have a reason to want to.
But to the ancient Israelites who heard and said this Psalm, the law was something a little different. For one, it was much more than just a rulebook. Yes, Leviticus especially as well as Deutoronomy and Exodus have long sections of regulations and codes. However, much of those first five books is the story of the people of Israel, especially in Genesis and the main part of Exodus. And when we read Jesus or Paul talking about the law, that's what they meant: all of those first five books, given in Hebrew the name Torah.
That name is another wrinkle. Although we usually translate it into English as "law," it was often used also to refer to "teaching." For Jewish people from the time of this Psalm to today, the world Torah will make them think "teaching," maybe even more often than they think "law code." Observant Jews will say, as does this Psalmist, that they delight in the Torah, or the teaching. They will ask God to teach them and give thanks that he does.
For the ancient Israelites, the Torah was a sign of God's relationship with them. He had already made covenant with them, through Abraham, Isaac and Jacob, and then renewed it with Moses and again with David. God had said, "I pick you," and he didn't say, "Subject to do-overs if I feel like it." Then, in order to make their chosen status stand out, God gave the Israelites the Torah so they could know how God's people ought to act. Other people might have bizarre religious practices like human sacrifice or temple prostitution, but not God's people. Other people might think nothing of the rich using their wealth to treat the poor however they wished, but not God's people. Other nations might trust in the strength of their armies, but not God's nation.
In fact, the Pharisees originally focused on the same idea -- people who call themselves God's people ought to act like God's people. Legalism and hair-splitting took over that idea and made the smothering code Jesus' opponents used to try to trick him, but they started out just wanting to know how to follow the Lord.
Christians ask for the same kind of guidance in our lives, don't we? When facing an issue or a problem or a choice, we often want to know what God would like us to do so we can choose actions based on how they bring us closer to him. Maybe not as often as we should, but that's the idea. We might use the same words we read here: "Teach me, O LORD, the way of your statutes." Or "Turn my heart to your decrees." We might use others, too.
Now, sometimes we might say we don't know what God wants us to do. There are certainly issues we face today that are not in the Bible, because we live in a different time and deal with different things. But many of the times we ask, "God, show me what to do" God has already answered the question through his teaching.
For example, we are unlikely to run across a robbery victim left lying beside the road between Jerusalem and Jericho, so we may believe the story of the Samaritan is interesting but not very useful. But when we see someone picked on because of his religion, or because she lacks social skills and dresses funny, we know what we should do if we see them like the Samaritan saw the robbery victim -- our neighbors. And I bet we can remember what both Old and New Testaments say about how we respond to our neighbors.
If we want to follow Paul's direction not to be conformed to this world but be transformed, if we want to change our lives so that we can lead changed lives, if we want people to know we're God's people because we look and act like God's people, we need God to teach us. Our prayer can echo the prayer of this Psalmist -- not seeking a sterile and impersonal law that obstructs us but a teaching that enlightens us.