changing the physics material on a rigid body2d

i have a rigid body2d on my player and at diffrent points in the game they need to have diffrent ffrictions how to i change the material on the rigidbody2d? i tried

public PhysicsMaterial2D material;

but no luck

nevermind im a absolute idiot. for some reason the 2d version is PhysicsMaterial2d and the 3D version is PhysicMaterial idk why they added an but whatever

PhysicsMaterial2D is the correct spelling (it’s Physics). The 3D one is spelt incorrectly but it’s a legacy issue from many years ago.