You can nest indexed access: T[K1][K2] looks up the type of a property inside another property. Constrain keys so each step is valid: K1 extends keyof T and K2 extends keyof T[K1].
function get<T, K extends keyof T>(o: T, k: K): T[K] {
return o[k];
}
Now extend this pattern for two levels of depth.
Read a nested property at two key levels.