The words some and any are used for countable and uncountable nouns. In general, we could say that somemeans a few / a little and any means none in negative clauses or a few / a little in questions.
Positive Clauses
In positive clauses, we usually use some.
Example:
I have bought some bread.
I have bought some apples.
Negative Clauses
In negative clauses, we use any. Note, however, that any alone is not a negative - it must be not ... any
Example:
I have not bought any bread.
I have not bought any apples.
Questions
In questions, we usually use any.
Example:
Have you bought any bread?
Have you bought any apples?
Compound Words with some & any
Some & any can also be part of compound words such as:
something / anything
someone / anyone
somewhere / anywhere
Note that some & any have to be used with a noun while compound words with some & any can stand on their own.
Example:
I have bought some bread.
I have bought something.
However, some and any need not stand directly before the noun. Sometimes, the noun appears somewhere before some or any and is not repeated. So if you are not sure whether to use some or something for example, check if there is a noun in the sentence that you can place after some.
Example:
I do not have to buy bread. Rachel has already bought some[bread].
Exceptions
Positive Clauses with Any
We usually use some in positive clauses. But after never, without, hardly, we use any.