I need the functionality of both OnTriggerEnter and OnCollisionEnter in unity

I have game in development process in which i have a ball [I have to throw] which must be collide with other balls and behind these balls i have to trigger it with other cube [must be OnTriggerEnter On for the purpose that ball just pass on to the cube] . So my question is that whether i have to use in script [OnTriggerEnter] for the ball i have to throw or to use OnCollisionEnter.

Im confused as to what you are trying to do however i can tell you what each one means

OnTriggerEnter will only run when the ball will pass through the cube (The cube will need its trigger option ticked in the inspector)

OnCollisionEnter will only run when a ball hits the cube, (The cube will need its trigger option unticked in the inspector)

I would say for what your wanting i think your looking to use OnTriggerEnter only if your wanting the balls the pass through