Local second-order approximations and applications in optimization