Welcome to Android Central forums.
Which Samsung do you have specifically?
Which messaging app does this happen in? If you're using Google or Samsung Messages, do you also have RCS enabled?
If you think back are you doing anything before this, commenting on a post somewhere, performing a search, any kind of typing?
You are certain that the message is received both times or does it only appear to send twice on your end?
Are you using swipe typing, voice or tap typing?
Which keyboard are you using?
Without knowing which app you're using I did a quick search and found this question being asked on Google's help boards. The OP there received no help and was advised to create an error report.
I only found the question in one other specific Android app forum and on iPhone forums. My advice would be to perform a cache wipe for the messaging app, and the keyboard app you're using. You can do this by going into the app list in your settings and locating each then choosing storage and Clear Cache for each. Alternatively you can get an app from the Play Store like Cclean and uninstall it after use if you don't want it.
Let us know what you find and we'll offer more advice.