There are many restrictions placed upon Jews on Shabbat that prevent them from doing even relatively simple things like switching on a light or heating up some food, etc.

Although biblically there is no prohibition against a non-Jew doing something for a Jew on Shabbat, to keep the spirit of Shabbat, and as a safeguard against violating it, the Sages prohibited a melacha (form of work prohibited on Shabbat) to be done by a non-Jew for a Jew on Shabbat.

However, this rabbinic prohibition is only violated if one of two things occurs:

The Jew asks the non-Jew outright to do a melacha for him. This includes a command, request, significant gesture, or even answering "yes" if the non-Jew asks, "Do you want me to do such-and-such?" The Jew derives direct benefit from the melacha performed by the non-jew. This means that the benefit obtained by the Jew is a direct consequence of the melacha performed by the non-jew. This would not include, though, a melacha which removes an obstacle thereby allowing the Jew to derive benefit; that is called indirect benefit.

In order for the melacha done by the non-jew to be permissible, it must be done in a way which avoids both the above conditions. A classic example is to hint to a non-jew to turn off the light in a bedroom so that a Jew may sleep there by saying "The light was accidentally left on in my room. I will have trouble sleeping." There was no explicit command or request, so #1 is avoided, and turning off a light is considered indirect benefit, since it removes the obstacle (light) which prevented the Jew from deriving benefit (ability to sleep). So #2 is also avoided. Thus, this case is permitted.

However, if the non-Jew was asked to do so outright, or if he turned on a light in a room for the benefit of a Jew even without being asked at all, both of these cases are prohibited (by conditions #1 and #2 respectively), and the Jew may not derive benefit from the non-Jew's actions.

Two other important exceptions to this rule are: