As answered on your other similar question:
F is not E#, they only sound the same. It’s because you can higher and lower naturals with flats and sharps.
So E sharp and F sound the same, but so do:
E and Fb
G# and Ab
D## and E
A# and Cbb
Although double sharp or flat notes are rare, they do exist.
When to use F or E sharp depends on the scale or chord or key you want to play.