Using gardening as an example, choose a fruit or vegetable your child likes, then go with them to a store and buy seeds / trees / whatever. Then get them to help you plant it and look after it. Children love harvest time, the excitement is palpable.
If you have chickens you can feed them wheat. If your child likes bread then you can show the child how to turn wheat into bread.
The key is not to force things. Monkey see, monkey do. If my nephews see me doing yoga, suddenly they are all trying their best to copy me.
For programming, I am not sure. But i think the best way is to start with a simple language that can alter something visual, so that there is clear cause/effect.
I'd love to hear any other examples people have!