Complex sentence: Shiva's function is to destroy, if he gets a child exactly like Lord Shiva then the child will cause the destruction of whole yadu dynasty, this is why he prayed to have a son like Shiva.
Split into simpler sentences: Shiva's function is to destroy, if he gets a child exactly like Lord Shiva then the child will cause the destruction of the whole yadu dynasty. This is the reason he prayed to have a son like Shiva.