Most of the time this question gets answered backwards. Someone falls in love with injection molding because the parts look clean, or picks CNC because it is familiar, and only later finds out the part cannot actually be made that way, or that the cost structure does not fit the order size. Working the decision in this order avoids that: volume, then geometry, then budget.
Volume decides if tooling cost is worth paying at all
CNC machining needs no mold or die, so it works fine anywhere from a single prototype up to a few thousand parts, but every part costs close to what the last one cost, since you are paying for machine time each run. Injection molding is the opposite. A steel mold commonly runs $50,000 to $200,000, so it only makes sense once you are committing to 10,000 or more parts, after which per-part cost drops close to nothing. Die casting sits in a similar spot for metal parts, usually not worth it below 5,000 to 10,000 units over the product's life. Sheet metal is the flexible middle ground: a turret press or brake keeps tooling cheap at low volume, and a progressive die takes over once you are at real volume.
Geometry rules out what physically cannot work
This is where a lot of process choices die before cost even matters. CNC cannot cut a sharp internal corner, since it is limited by the round cutting tool, and gets expensive fast on organic curves or deep pockets. Sheet metal needs bend reliefs and a minimum bend radius, roughly 1 to 2 times material thickness, and also cannot produce sharp internal corners. Injection molding and die casting both want uniform wall thickness and draft angles built in from the start, and both charge extra for undercuts unless you pay for slides or lifters.
Budget is really a question of when you pay, not how much
CNC and low-volume sheet metal keep upfront cost near zero and per-part cost roughly flat, which suits a small order or a product that is still changing. Injection molding and die casting push most of the cost into the tool before a single part ships, then per-part cost gets very cheap once you are running, which only pays off once volume is committed.
A quick way to gut-check the decision
Before committing to a process, get quotes from two candidate processes on the same part and see what actually changes, since the difference is often bigger than expected once tooling enters the picture. A machinist or molder you know can also eyeball a design and flag if it does not fit the process you are picturing. Running the file through a DFM check tool is another option worth having in the mix. fabdose's Auto Comparison (Pro) runs a design through every supported process, CNC, injection molding, die casting, sheet metal, and scores each one on manufacturability issues found plus relative cost, then flags whichever scores highest. It's one way to sanity-check the volume, geometry, budget reasoning above against a specific part, not a substitute for working through it.