conjunction
Used to refer to a manner or method previously mentioned or understood from context. Often implies doing something in that particular way.
そうやって問題を解決したんだ。
That's how I solved the problem.
そうやって毎日練習すれば、上手になるよ。
If you practice like that every day, you'll get good.