This will automatically change the state of your record in the given date.
Then, if you are using build triggers, you can ask to trigger a build automatically when the scheduled publication/unpublication is done.
You can find the setting for that in the build trigger settings, here: