Deuteronomy 15:15-23

15 And keep in mind that you yourself were a servant in the land of Egypt, and the Lord your God made you free: so I give you this order today.
16 But if he says to you, I have no desire to go away from you; because you and your family are dear to him and he is happy with you;
17 Then take a sharp-pointed instrument, driving it through his ear into the door, and he will be your servant for ever. And you may do the same for your servant-girl.
18 Let it not seem hard to you that you have to send him away free; for he has been working for you for six years, which is twice the regular time for a servant: and the blessing of the Lord your God will be on you in everything you do.
19 All the first males to come to birth in your herd and your flock are to be holy to the Lord your God: the first birth of your ox is not to be used for work, the wool of your first lamb is not to be cut.
20 But year by year you and all your house are to take a meal of it before the Lord, in the place of his selection.
21 But if it has any mark on it, if it is blind or has damaged legs, or if there is anything wrong with it, it may not be offered to the Lord your God.
22 It may be used for food in your houses: the unclean and the clean may take of it, as of the gazelle and the roe.
23 Only do not take its blood for food, but let it be drained out on the earth like water.