I've read that both so and thus mean "in this way" but I can't understand when I have to use so and when thus.
Consider "thus' as being used in poetic, literary or formal writing, and 'so' in everyday writing and speech.
You may hear a teacher of mathematics/geometry or physics use "thus', as in "...which gives us angle A = 40º. We know that angle B is 90º and thus, angle C must equal 60º."
Similarly, in scientific publications, the stating of a conclusion may start with "Thus, our hypothesis that cartoon violence and adolescent crime ..."