You should only say something you know is correct. You know that a sentence is correct if you've heard a native speaker say it before. Or if you've heard them say something very similar. However, this may not always be possible. In such cases, there are several options available to you.
First, assume that anything that doesn't come from a native speaker is incorrect. This includes:
- Machine translations from sources like Google or Deepl.
- Sentences you construct using memorized words and grammar rules.
Try searching examples online. There are many websites that can help. By typing in the words you want to say, you can find similar sentences in your target language. You can also search in your Anki collection. Chances are, you've mined a sentence that is close to what you want to say.
In a situation where you can't use the Internet, your only option is to say something different. Or to say what you've come up with yourself and remember to check later if it's correct. Keep in mind that just because a native speaker understands you, it does not mean the sentence is correct. It may contain mistakes.