While there are ways to delay iPhone iOS updates/upgrades, they are either convoluted and/or useless. You won't be assimilated (by the Borg), but you will update your iOS device.
However, you can turn off the forceful reminders to update your Mac. In the most recent versions of macOS, go to the App Store, then Preferences and uncheck the updates. In older macOS versions like Yosemite, go to System Preferences > App Store. You get about the same dialog box either way.
Once you have unchecked checking for updates, it is important that you manually check for updates and install any security updates that you see. To do this, go to the App Store (under the Apple Menu) and click on Updates.