If a husband is impotent or died before he fathered a child, his wife can seek help from a close relative, for example the husband’s brother.
In the Mahabharata Dhritarashtra and Pandu were fathered by Niyoga.