Ed M. answered 03/25/16
Tutor
4.9
(40)
Help with grammar, French, SAT Writing, the TOEFL and ESL.
This is a good question because it illustrates how idioms can present particular difficulties for learners of not just English but any language. An idiom is a combination of words in a language that has a special meaning and/or usage that cannot be predicted or departs from that of its component words, i.e., the literal sense. That is, to help oneself, i.e., the use of the verb help with a number- and gender-appropriate reflexive pronoun, can be used in the transparent sense of 'to give aid to [i.e., 'help'] oneself' and when used in this sense and followed by a verb or verb phrase that illustrates the means by which one does this, the preposition by is required, e.g., You can help yourself by studying more and I helped myself by visiting WyzAnt.
However, one idiomatic meaning of to help oneself is 'to (par)take' with an additional layer of meaning something like 'freely' or 'without asking for permission or restraint'. This idiom can be either intransitive, i.e., not requiring a direct object as in The scrumptious pie was just sitting there, so I helped myself and A: May I have some of that coffee? B: Sure, help yourself, or transitive, requiring a direct object, and in the latter use the preposition to--not by--is required. In other words, the "correct" form of the sentence you give should be You can help yourself to some sweets, which thus means something like 'Please take [or 'have'] some sweets'.
Another minor point is that sweets in this context is primarily British English for the foodstuff that Americans would usually call candy, with the complication--of course--that candy is normally an uncountable noun in contrast to the countable, i.e., pluralizable, sweets, which means that to particularize candy one would need to introduce another noun altogether, e.g., You can help yourself to a piece of candy (<--said by a very stingy host).
Ed M.
03/25/16