The first position is lost for white whatever he plays, the second wins indeed in the way you described!
How good are you?

oui, les blancs perdent dans le premier et dans le deuxième, les bonnes réponse ne sont pas les meilleurs coups. D'où viennent ces positions?

The first position is lost for white whatever he plays, the second wins indeed in the way you described!
Think about it a little more…

In the first position, black throws away the win with g3. Instead, f3 wins. This is a tablebase position, so the true result is known.
In the second position, there are multiple solutions again and again, starting at move 10. The puzzle should stop at move 9.

These puzzles are very hard, not for beginners. Neither of them has a simple 1-move solution. Your f4 loses immediately.
One thing that you can (and should) do is to learn chess notation (how chess games are written down).
https://en.wikipedia.org/wiki/Algebraic_notation_(chess)
If you need help, please contact our Help and Support team.
2 king and pawn endings to test your skills
white to play and draw
white to play and win