On any car if you get a check engine light or other fault light this typically means one or more of the sensors has failed or has a faulty connection.
The ECU senses this and may put the car into 'limp home' mode which typically limits the revs and the amount of power available. Usually the car is safe to drive for a short distance as the mode is intended is intended to get you home without incurring any engine damage
The quickest route to repair is to have the car plugged into a diagnostic machine which will read off the fault code stored in the ECU (providing the light is still on at this point) and indicate which sensor has failed or whether the fault is more serious.
Sorry to say that as the car is 2nd hand then you can't very well return it to the manufacturer and use the 'not fit for purpose' consumer rights
I'd suggest getting the fault code read as if the car is driving fine its likely to be minor
this will give you a better idea of whats actually wrong