Foolishly has 2 different meanings across 1 category:
Adverb
without good sense or judgment
"He acted foolishly when he agreed to come"
In a foolish manner.