I have declared my ways
That is, to the Lord; either the ways he had chose and desired to walk in, and not wander from, and therefore entreated help and assistance, guidance and direction, in them; or his sinful ways and actions, which he acknowledged and confessed, lamented and bewailed, and entreated the forgiveness of; or all his counsels and cares, his affairs and business, in which he was concerned, and which he declared and committed to the Lord, to be directed and assisted in; or all his wants and necessities, which he spread before him at the throne of grace; which he did not as though the Lord was ignorant of these things, but partly as knowing it was the will of God that he should be inquired of by his people, to do the things for them they want; and partly to ease his own mind, and encourage his faith and hope in the Lord;
and thou heardest me:
and directed him in the way he should go, and what he should do; forgave him his sins, and supplied his wants;
teach me thy statutes;
which he desired to learn and obey, in gratitude for being heard and answered by him; (See Gill on Psalms 119:12);