In order for the seed to be viable, the seedpod needs to be mature, which is when it turns yellow, about 4-5 weeks after flowering. You could plant the entire pod, but since it contains lots of seeds, it is advisable to remove the seeds from the pods and plant them individually. Usually they are planted in pots or a flat with a light soil mix, and then once the plants are of good size, move them to the garden.