How to wire modern telephone extension?
We're having to make assumptions here that this is house wiring for an single analog phone circuit (POTS) as no specifics other than "it's a phone extension" are given.

This is a four wire cable with a green/red and white/brown circuit. POTS requires a pair of wires. Your house could be wired having up to two separate phone lines if this is the only wire used. Typically older houses are wired with four wire cables, newer houses with CAT4 or 5 have four pairs (8 wires) available for phone circuits.

If it's a single line phone circuit, the green/red wires should be the only ones that need to be hooked up. What's the difficulty with connecting them back up observing the color coding? This is assuming that the socket is using screw connectors, the straight on angle doesn't allow the connection method to be seen.