The reason you’re hearing an echo when trying to record with your Scarlett 2i4 is because you’re hearing your direct feed from the microphone plus the feed from your DAW. The feed from your DAW is slightly delayed due to the latency generated from the signal having to travel to your computer and back out to your interface. On the Scarlett 2i4, there is a mix knob on the front that allows you to hear only the direct source, only the DAW source, or a mix of both. If you want the echo to go away, consider turning the knob all the way to Input.
If you need to hear what’s coming from your DAW, turn the knob all the way to playback. Note that the signal will be slightly delayed. You can minimize the delay by adjusting your buffer size to a smaller setting. However, this will make your computer work harder and you may experience some issues. If you do, just set the buffer size back to a larger setting.