While I did grow up in a place where many people still believed in magic, I have not seen the kinds of magic that you mention being used. In this answer, I will explain these two types of magic. Perhaps you can use the descriptions to determine if you, yourself, have ever used such magic or seen it in use.
The law of contagion states that things that have been in contact with one another will somehow remain in contact even after their physical contact has been broken off. One example of this is the idea that an enemy can harm you by using things like your hair that was left behind on a brush or your nail clippings. Since those things were once in contact with you (and were actually part of you) they will still retain some sort of magical contact with you. Thus, an enemy can harm you by harming them. This is contagious magic.
The law of similarity says that all things that are similar are, in fact, the same. This means that anything that is similar to you can be used to harm you. The classic example of this is the use of a doll that represents a person to harm that person. Some cultures believe that doing things like sticking needles in a doll can bring actual harm to the person that the doll is supposed to represent. This is imitative magic.
With these definitions in mind, you should try to determine whether you have seen people using these types of magic. I have not seen it myself and I have not tried to use such magic.