Light switch using only black wires - Incoming whites terminate together in box - New timer switch requires white neutral
I am assuming that there is a bundle of neutrals (the white wires) in the box. First determine which is the line side (hot) conductor and which is the load (switch leg) conductor on the existing switch. This is important since you are installing a time and the Hot must be on the correct lead. First connect the Ground (bare or green) conductor to the timer. Now you connect the Hot to the correct lead (probably the black) and then the Switch leg to the proper lead (probably the red). All that is left should be the  connection of the neutral unscrew the wirenut attached to the bundle of white wires, add a pigtail and attached it to the proper location on the timer.

I am assuming you are using safe practices by never trying to connect or splice wires will the breaker is hot. First identify then kill the circuit then splice and connect.

I am not sure you know what a pigtail is so here is an illustration.



Godd luck and stay safe.