Get process handle(s) from the process name using NtGetNextProcess and GetProcessImageFileName API calls.
It returns a list of process handles which you can use for example to get the PIDs using GetProcessId:
If you prefer Go, you have the same implementation in: https://github.com/ricardojoserf/go-GetProcessByName/