In order to correct the sentence and avoid the dangling modifier, you need to include a subject in the sentence. You can choose any subject you prefer, such as he, she, they, Jack, Naomi, or any other noun or pronoun. The important thing is to make sure that the subject is the one doing the ironing.
For example, you could rewrite the sentence as:
"The pants looked much more presentable after he had ironed out all the wrinkles."
In this sentence, the subject "he" is the one doing the ironing. The word "he" clarifies who is performing the action of ironing, which eliminates the ambiguity of the original sentence.
Remember, when dealing with dangling modifiers, the subject should be clearly stated in the sentence to avoid confusion about who or what is performing the action.