disable a component that script is attached too

I’m try to disable a collider in script , then re-enable it later. I have tried many different ways, but none appears to be working. I know it is a simple solution, but the method escapes my mind.
this is 2 of them that I thought would work, but…
also i am using JS, but I can and know how to convert.

Component.Body.enable = false;
Component.Body.CapsuleCollider.enable= false;

collider.enabled = false;

is what you´re looking for.

collider is a shortened version of GetComponent(CapsuleCollider) used to access the objects Collider component.