Restrict shipping method for specific city

I’ve two shipping methods (flatrate + custom method ) I want to restrict them for specific city.

How I can do that ? I’ve checked too many posts regarding this but I didn’t find the answer.

I need detailed answer please.

Thanks in advance.