@akitsukino Editing. Cut off anything that doesn't serve a purpose, no matter how beautiful it sounds. This may include dialogue, exposition, world building, etc. etc. You'd be surprised how far you'll get by writing about things of immediate/future importance, as there's always things to expand upon and a world to build.
In the words of my favourite author(paraphrased): "If it doesn't build your world, develop a character or introduce plot elements(there was a fourth thing here that I can't remember), throw it away. It's useless." Now, I say this with the caveat that sometimes seemingly useless scenes are necessary to switch up the pace(a battle scene, for example, to introduce a change of pace to continuous world/character building), but even then those should be related to the plot and should tell us something about the characters. The best sentences and paragraphs are the ones that do multiple things at once(world building and character development, for example, through expressing a character's world-view in their dialogue).
I apologize for a badly written post. I am rather tired. A lack of sleep has struck me, and it has struck me good.
EDIT: In my experience, tangents happen when a writer doesn't know EXACTLY what they need to write. What I mean is that they have a very vague idea of how to move the plot forward, and might not even have a focal point somewhere in the story's future to move the story towards. Thus, I recommend doing some light outlining(if it doesn't interfere with your writing style) to figure out the main scenes that your story will pass through. Then you'll just have to constantly reorient your story towards these beacons during your writing. This greatly lessens the amount of tangents you'll have.