You can train Prayer by burying bones, or offering them to the Chaos altar. For example to bury 100 Dragon bones, you can do +bury 100 Dragon bones, or to bury the maximum amount you can: +bury Dragon bones.
Offering the bones to the Chaos altar works exactly the same, except you use +offer instead, for example: +offer 100 Dragon bones.
The Chaos Altar works like ingame, your minion will do 1 inventory trips back and forth to sacrifice, with a 10% chance of being PKed in the trip and losing some amount of your inventory of bones (depending on if you got PKed at the start/middle/finish).
The Prayer skill is also required alongside smithing in order to create the Spirit shields.