how to change variables for some time

Hello guys, I apologize if the question is stupid… but I am in the learning stage…
how to change variables (speed player) after collision with object for Seconds and back it to the original variable

Thanks in advance

This provides a number of examples… pick one that works best for your situation.