It really depends on how you prefer to travel; including your level of comfort and available budget. Plus, the origin and destination of your journey will determine the most convenient method of transport.
The fastest way to travel is by plane, and this is recommended for journeys to Panama city. However, getting from David Panama to San Jose Costa Rica is much easier as it is only a six-hour bus ride.