Creating an in-game update system is a difficult task and can't really be answered in a simple question. There are a lot of variables to account for. Also, most people who need automatic updates will end up using a store like Steam instead of relying on direct distribution. Since stores handle updates for you, you don't have to implement anything specific in your project for that.
Checking for updates is much easier; here's an example that uses GitHub Releases (but it's still not 100% trivial to have a reliable implementation).