Change size of a rigid body/collider in script?

I have a rigid body and collider setup and I’d like to change its size on certain events (such as on a collision).

Is there a way to change this directly or will I need to destroy the rigid body and collider then create a new set of those two for the game object?

When you change local scale of transform of a game object, size of the collider of the game object changes automatically. Or you can also change size of the collider directly.

GameObject go = ...
go.GetComponent<BoxCollider>(); // i assume the game object has a box collider
bc.size = new Vector3(2,2,5); // im changing size of the box collider

I hope this helps.