First identify the problem if your teacher hasn't yet done it. An example is: Having barked all night, I decided to get rid of my dog. If you think about this sentence, it is funny. It actually says that "I," the owner of the dog, barked all night! "Having barked all night" is a participial phrase. The problem exists because the phrase must come right before the noun or pronoun it refers to. "Having barked all night" looks like it is describing "I."
Fix the dangling participle by giving it the correct subject. You can put the subject right before the participle, like this: My dog having barked all night, I decided to get rid of him. "My dog" is the subject of "having barked."
Or upgrade the participial phrase to a complete clause, using the true subject plus a complete verb. This can be done several ways, but a common way is to make it subordinate: Because my dog barked all night, I decided to get rid of it.
For another fix, change the subject of the main clause to match the phrase that was dangling. This is sometimes harder to do: Having barked all night, my dog now resides at the pound. You have to change the meaning of the main clause so that the implied subject of "having barked," the dog, is now the subject of the main clause. The owner, the "I," has disappeared.
Practice with one more example: Having blown the head gasket, I took my car to the junkyard. Change it to: My car having blown the head gasket, I took it to the junkyard. Or: Because my car blew the head gasket, I took it to the junk yard. Or: Having blown the head gasket, my car has been recycled. Try these changes with some sentences of your own, and you will be able to fix the commonest type of dangling modifier.