Here you are looking for ALPHA hydrogen acidity. Formaldehyde doesn't have any alpha hydrogen. (All hydrogens are on carbonyl carbon).
Between ketone and aldehyde: They both have alpha hydrogen but different in the nature of groups attached to the carbonyl carbon. H atoms DON'T WITHDRAW or DONATE, basically they have no electronic effect. Alkyl groups are weakly electron donating, they tend to destabilize the anion. Therefore aldehyde alpha hydrogen is a better acid than ketone alpha hydrogen.