Change Dynamic Friction During runtime

I have an object and I would like to change the dynamic friction property of the Physic Material

I tried to use

pm = GetComponent ();
pm.dynamicFriction = frictionFlat;

friction Flat is
private float frictionFlat = 0.2f;

unity keeps telling me:
MissingComponentException: there is no ‘Physic Material’ attached to the “Player” game object.

when I inspect player(my player game object) in unity, under CapsuleCollider I do have a Material set that is called “SlidePhysics”

What you need to use is this:

PhysicalMaterial pm;

pm = GetComponent<CapsuleCollider>().sharedMaterial;

since your physic material is under your capsule collider, you must fetch the capsule collider component from your gameobject, and then access the physic material within. You can see here Unity - Scripting API: CapsuleCollider that the physic material is kept in the sharedMaterial property.