To takе slееpіng tablеts іs harmful = correct but very unnatural
Taking slееpіng tablеts іs harmful = natural English
Both are correct, in theory, but the first is very outdated. You come across this use of to + infinitive at the beginning of a sentence in old-fashioned expressions such as 'To err is human, to forgive divine', but this construction is very rarely used in modern English.
These days, we nearly always use the gerund when the verb is the subject that begins the sentence.
Note that we do use the infinitive in sentences such as 'It is harmful to take sleeping tablets'. It's fine to put 'to take xx' at the end of the sentence, where the sentence begins with the dummy subject 'It'.