The two examples you have given aren't comparable. Allow me to explain.
"I stopped to smoke" = "I stopped for a short time so that I could smoke."
"I stopped smoking" = "I stopped smoking and don't intend to smoke agan."
---
"Try to sleep" = "Have a go" / "Have an attempt" at sleeping. It means... "Do your best to sleep". It's ALMOST a command.
"Try sleeping" = It's more of a suggestion or a recommendation.
Mr X: "Sometimes I feel drowsy in the afternoon, maybe it's because of caffeine or something"
Mr Y: "Try sleeping" / "Try sleeping more."
-----
The two examples you have given aren't the same at all though. To put your "smoking" example into the second sense, you should say:
"Try to smoke" = "Do your best to smoke". [Like, "try to sleep"].
Or ..."Try smoking" = "Why don't you have a go at smoking?" [Like... "Try sleeping.." ... it is a recommendation or suggestion].
-----
Likewise, "I stopped to sleep" = "I waited a moment so that I could get some sleep".[Like, "I stopped to smoke".]
OR: "I stopped sleeping" = "I stopped sleeping. I don't know if I will ever sleep again". [Like, "I stopped smoking".]
---
The examples you have given aren't parallel at all....
I hope this helps anyway,
Take care and good luck!