I hold a Philippine passport, planning to go Costa Rica for 5 days or so, I’ll fly with KLM ,do I need a transit visa in Amsterdam and Panama for lay over ?
Usually (but not always), you don't need transit visa if you aren't planning to enter the country in which you're transiting through (provided the airport you are flying through allows you to stay 'airside', which isn't the case, for example, in any US airports).
As a Philippine citizen, you don't need a visa to transit at Amsterdam airport.
Some nationalities require transit visas even for airside transit, without entering the country. For example, as a Philippine citizen you would need one to transit through a French airport, as Chris H mentioned in the comments.
You would also need a visa if you have two transits in the Schengen zone for example Manila-> Amsterdam-> Paris-> Costa Rica. As you'd be entering the Schengen zone proper, this would also apply for people with citizenship that doesn't need a visa for a single transit, as for those who needs a transit visa anyway they have to apply for it in case they are going to transit in the schengen zone and it depends on the nationality and the schengen state that you will be transiting through. Check this link to see if you are your nationality requires a transit visa for the Netherlands.