It depends on what shape you're using. Each of the Shape2D objects has its own properties. For example,
radius for CircleShape2D or
extents for RectangleShape2D.
As an example, if you have a CollisionShape2D with a RectangleShape2D as its shape:
$CollisionShape2D.shape.extents = Vector2(x, y)
or a circle shape:
$CollisionShape2D.shape.radius = some_value