I tried to don’t laugh, but it was impossible.
I tried to not laugh, but it was impossible.
I tried not to laugh, but it was impossible.
The usual negative form of a to-infinitive is not to + verb: not to laugh, not to go and not to say.
Do not use don’t/doesn’t/didn’t after to.
It is also possible to put not after to, especially for emphasis. However, not to + verb is the more common and useful pattern.