So, we use some with questions that are offers or requests.
Examples:
Offer Would you like some milk?
Request Can you buy me some milk?
And we use any in questions when we don’t know if something exists.
Example:
Do you have any pizza?
Exceptions to the rules
We can sometimes use any in positive sentences
When it is not important which one
Pass me any drink.
We can go to any game you like.
When the sentence has a negative idea
We never get any chocolate
We hardly ever buy anything nice.
He stayed there without any clean clothes.
When we use if
Let me know if you need anything
I am sorry for anything he has done wrong.
Anything/Something, Anytime/Sometime, Somebody/ Anybody
Something(unspecified thing)
I want something but I don’t know what.
Anything
I didn’t buy anything.
Sometime(unspecified time)
Let’s meet sometime on Friday.
Anytime
Anytime on Friday is fine.(it doesn’t matter)
Someone (unspecified person)
Someone took my pen.
Anyone
Does anyone have a car I can borrow?
All of these words follow the same rules as any and some. Notice how any is used with time. Anytime= a time that doesn’t matter.
Look at this example
Someone means an unspecified person but anyone adds more meaning. Anyone is whatever person and he is looking for help.
Read more about someone vs anyone here.