The way sensei tells you to
I think there are a number of ways that vary from dojo to dojo but generally I think you want a reef knot not a granny knot as it holds better.
To throw into the mix I found this link. This is how the Yuishinkai handbook tells us to tie it. It seems to have a couple of advantages to the karate tie above (which I tend to do with the hakama on) , first you don't get the belt crossing at the back which has the potential to cause problems on a roll or fall. Secondly with the ends passing through between the two layers of belt that gives a stronger hold. Specially so with those stiff white belts beginners start with, I find this holds pretty well and no potential twist at the back.