I want to edit the functionality of my checkout page, such that if a customer is from a ‘city’ other then the specified, then they are not able to checkout and are rather given an error prompt of “Not delivering to this city at the moment”.
You can set shipping zones under the Shipping & Delivery section but the functionality that you are asking is unfortunately not possible within Shopify at the moment. You might have to opt for some workaround.