How do I increase forward velocity of a 2D ball when it bounces?

Hello There,
I want to know what commads I would use and how I would use them to increase overall velocity of a 2D object. I have players and obstacles in the world. When the ball bounces off a player, it should all around get incrementally faster (maybe like 1.1 or 1.2 times its current speed) and when it bounces off an obstacle it decreases speed incrementally (maybe 0.8 or 0.9 times its current speed). Thanks!

Something like this should work:

    private void OnCollisionEnter(Collision collision)
    {
        if (collision.gameObject.CompareTag("Player"))//if collision is with player gameObject
        {
            rb.velocity = rb.velocity * 1.2f;//increase velocity by 1.2 times, try different values
        }
    }

put this code in a script on your ball.

This is my 386th answer! That was my goal since I learned to program on an IBM 386 26 years ago! Thanks everyone!