In this sense, I do not think it make sense.
I believe you are thinking of the meaning similar to your original definition of "trying really hard to do something"
"the best thing we can do to learn another language is to go out of our way" this seems like you are trying to say "the best thing we can do to learn another language is to try very hard".
You need to specify more of what exactly you are "going out of your way to do".
This expression does not have a sense of "trying hard" unless you state this specifically.
example: "To learn a language you need to go out of your way to try hard"
But in my opinion the best way to express this idea would be:
"To learn a language you need to go out of your way to practise every day"
"To learn a language you need to go out of your way to put in effort"
As you can see the examples are more specific about what exactly you are "going out of your way" to do, which will help you achieve the goal of learning a language.
Hope this helps!