Let's start with the easy fixes and work our way up.
What is the latency from you to the VoIP.ms server you use? You can test this by opening a command prompt window and typing ping toronto.voip.ms - obviously, replace toronto with the server of your choice. Theoretically, the lower the latency, the better.
Are you using premium routing? If not you may wish to test that. Occasionally, value routing has sound quality issues. (That's one reason it's cheaper.)
You may wish to turn down the volume on your phone, if it has volume control.
What hardware do you have? If you have a Linksys ATA, there are a few settings to look at:
On the line tab, enable all of these, if you have them. This is the default, so they should already be set this way.
Echo Canc Enable
Echo Canc Adapt Enable
Echo Supp Enable
If the above were already set correctly, on the regional tab, enable More Echo Suppression if you have this option.
If that still doesn't solve the problem, we need to adjust the FXS Input/Output gain. This may be found on the Regional tab, and you should reduce one, then the other, in increments of 3. Finding an appropriate volume for a comfortable conversation, that will not cause echo can be a balancing act, but once you find it you should be safe to leave it there.