What is the best way to go about developing and formulating a product?
I've had two food products made to my specifications via contract manufacturing and evaluated contract manufacturing of several other products.

Fundamentally the process requires you to have enough of an understanding of the product you want to be able to work with the contract manufacturer to make it. In one case, I didn't have any meaningful experience with production of the products (a flavor variation of chocolate dipped fortune cookies, and some custom flavor chocolates) but I did have a relationship with a company that already did such products and I knew of one or two others I could reach out to if needed. In another case, I had plenty of experience making variations of the products (a series of salad dressings, drinks, &amp; sauces basically) but no experience in arranging for the production of shelf-stable versions of it.

It turns out my limitations were relatively easily surmountable; the only reason I didn't end up doing the salad dressings were financial constraints and difficulty in procuring a key ingredient.

In both cases, I spent time researching and experimenting with the right ratios of ingredients for the product.

With the salad dressing example, I developed a basic recipe, then reached out to a company that happens to do a fair amount of that kind of work, and penciled out details regarding the approximate production cost range, and discussed questions about shelf-stability. Had I progressed any further, food scientists at the contract manufacturer were available to help analyze the recipe to determine any adjustments required for shelf-stability and other food safety considerations. There were probably some fees attached to their work, but those weren't as big of a concern, in my case, as getting one of the ingredients in "large but small" quantities from outside of the US. (Too small for full container load international shipping, yet quantities too large for small suppliers, etc.) Your problems will be different than mine.

With the chocolate products, I had a bit of base knowledge of the ingredients I was working with and had already done some other desserts using the signature ingredient. So with the help of the manufacturer, we tried a small batch run based on the ratio I felt would work. It was pleasant enough to sample to customers, though I wanted to make some further adjustments, so subsequent batches tweaked ratios a bit. Ultimately I settled on a formula that balanced my taste preference with the cost (and some technical considerations).

Most food product development requires you to have some foundational knowledge, either about the ingredients or the techniques involved, unless you're comfortable just throwing tons of money at reducing the problem space. Fundamentally you're trying to reduce the problem scope into small, solvable challenges instead of navigating a vast landscape of possibility. If you don't have the expertise required to get there, start by talking with people who do something similar enough that you can leverage their knowledge.