Your daemon program and the program that gives commands (commander) to the daemon must have a common resource between them.
For example the shared resource could be a file. The commander writes commands to a file and the daemon polls the file regularly for changes. When daemon detects changes it reads the file and executes the commands. You must implement file locking so that the daemon and commander do not try to access the file at the same time.
The shared resource could also be a socket. Your daemon opens and listens to a socket and the commander writes commands to it directly.
There are other options too. You should research "common inter process communication" using a search engine like Google.