There is no universally "best" growing method — each of the three main options solves a different constraint, and the right choice depends on your soil, budget, and how permanent you want the garden to be.
In-ground: the lowest cost, if your soil cooperates
Free if your existing soil is workable and well-drained. The tradeoff is that poor native soil — heavy clay, contaminated urban lots, or extremely rocky ground — makes in-ground growing genuinely difficult without years of amendment.
Raised beds: the middle ground most beginners land on
Higher upfront cost than in-ground, but you control the soil completely from day one, drainage is rarely an issue, and the soil warms faster in spring. The main downside is the ongoing cost of topping off settled soil, discussed in more detail elsewhere on this site.
Containers: the most flexible, most demanding of attention
The only option that works on a balcony, patio, or rental property where digging is not an option. Containers dry out faster than any other method and need the most frequent watering — often daily in hot weather — which is the tradeoff for their total flexibility.
A reasonable default
If your native soil is reasonably good, start in-ground and save the money. If it is not, or you are renting, raised beds offer the best balance of cost and control. Reserve containers for spaces where nothing else is physically possible.