An ad hominem attack is when you attack someone's character, instead of their ideas or behavior. If you criticize sleep training because it is bad for the child and explain why, that is ordinary criticism and argument. If you insinuate that people who do sleep training do not care about their children, that is ad hominem.
To use another example: if I explained your behavior in this thread by claiming that you are a narcissist who holds yourself above others and so feels they have the right to (verbally) punish others, has trouble seeing any personal faults, and easily sees character flaws in others, that would be an ad-hominem. I have not done that, because I don't know you and your motivations, it wouldn't be constructive, and most people aren't narcissists. But similarly, most people care about their children, and arguing that they disagree with you because they don't care enough is not constructive.