If you know the 2 that make the light work, then those will be tested one at a time and ONE of them will be power
use the voltage tester and touch one lead to the wire and one to the bare ground wires in the box.
Once we have the Power wire marked, you are ready to go.
Take the timer black wire and connect to the power wire just found
Take the timer red wire and connect to the other wire
Take the timer white wire and connect to that Bundle of white wires under that red wire nut.
Take the timer green and connect to the bare ground wire.
The white on the timer is the other side of power, the common. It must be connected in order for the timer to have power.
You will just cap off the unused wire form the original switch
That should get you going
let me know any problems.