I understand second and third cousins…that’s not the problem.
So - Jane marries Adam. They have a kid, Sam.
A few years later, Jane and Adam divorce. And Jane meets and marries Bob. Jane and Bob have a kid, Tom.
Now, Bob and Sam would be step-father and step-son. But what are Adam and Tom? Are they “ex-wife’s son/mother’s ex-husband” or is there another, more common way to refer to that relationship?