Wish we knew!
Yours is the million $ question with no answer. Family history and environment play their roles, but there is no easy checklist of things to do and avoid.
If there is a strong family history of autism
spectrum in your or your partner's family, your chances would be higher, so some people choose to adopt in those cases. The best path, though, is to live healthy and love the child you get!