As Glenn says, 'candy' is a noun and 'sweet' is an adjective. However, in British English, 'sweet' can also be a noun. It is what some people call 'dessert' so, for example, apple pie and cream can be a sweet. We also call things like Haribo 'sweets'.