Depends on the application.
You haven't described your application, so take my advices as general for most (but not all) situations.
I use assumption, that you want to decide between 2 types of CPU. 8C on higher base frequency, 16C lower. If 16C has higher base frequency or equal, the 16C will be better in most of situations.
Scenario A - Application utilizes all 16 cores and shares memory
In this case the 16 core will be better, because it makes only one NUMA node and memory access will be equally fast for all processes as always local.
Scenario B - Application utilizes all 16 cores, however can be divided to run in 8+8 core configuration with half memory each CPU
In this case 2x8C variant is better (running probably on higher base clock frequency). There are 2 NUMA nodes. So each 8C should only access local half of memory (the one electricaly connected to the socket) without penalization.
Scenario C - the application is capable of running in many independent threads, mostly in cache and occasional RAM access isn't problem.
In this case 2x8C variant is better (running probably on higher base clock frequency). Occasional memory access isn't much limiting.
There can be more situations, like when you have single thread applications etc.