Well, the phrasing in your example isn't the best, but basically, this is one way to do it and there's nothing wrong with it, though if you do this several times in quick succession, it'll get tedious.
"Hey, this is not good," Marcus said. He switched to German and added,
"I think we're going to have an issue with the police." Then he
continued in English again, "We should leave before we get in
trouble."
...is just about how far you can stretch it. A couple more and you'll start to get on your reader's nerves.
One other way is, of course, to actually phrase out what the character really said. I only know very little German, so this is going to be with the aid of Google Translate (anyone who does know German, feel free to edit this part to correct the language).
"Hey, this is not good," Marcus said. "Ich glaube, wir werden ein
Problem mit der Polizei haben. We should leave before we get in
trouble."
Well, that's very neat and nice... as long as your reader knows the second language you're putting in your character's mouth. If they don't... then you'd better make sure they don't get lost.
One thing you can do is to make sure there isn't anything really important your character says in the other language. (I'd say this is pretty much the case here - the German sentence is kind of redundant.) If your story allows it, which is honestly not very likely most of the time.
Another way is to give a direct translation, either just afterwards in the narration, or in a footnote. This is kind of a heavy-handed method, but there may come a time when nothing else helps.
And yet another way, which I personally like best, but which is very hard to pull off, is to surround it with enough context and hints that your reader figures out what the character said without getting a translation as such. The main pitfall here is obvious - you may estimate it wrong and give too little to go by. And at the same time, with one and the same text of your story, you're trying to not make things too repetitive for the reader who does know the language, and that's a precarious balance to keep.
In any case, keeping the lines in their actual language isn't generally the prefered method if the foreign-language text is long.
Or, some authors like to rely on a font change to convey the switch between languages. Imagine a fraktur type font here instead of bold (yeah I know that fraktur for German is kind of a stupid cliché, but it gets the point across easily).
"Hey, this is not good," Marcus said. "I think
we're going to have an issue with the police. We should leave before we get in trouble."
The main problem with this is technical. Will the change of font still be there for your reader? Won't it get lost somewhere during the publishing process? If the language you write in is one that uses diacritics, will all letters be right? Will a different font be displayed with no issue in the e-book version? And what about the person who reads your story from the internet archive with the aid of text-to-voice software?
I can't say I see any of those options as strictly ideal, but those are the choices that come to mind. Pick what you think is best - for you, for your story, and for your audience.
And just an aside - punctuation. If a dialogue tag follows the direct speech, you need a comma there, not a period (and a lowercase letter afterwards if it weren't a name).
"Hey, this is not good," he said.
It's different when you pair the speech with an action that isn't really a dialogue tag.
"Hey, this is not good." He looked around nervously.
To distinguish between the two, ask yourself, is it "he said something", or is it "he looked around nervously" (and the sentence is complete)?