I ran out of yarn. how do i connect

im knitting a scarf, and ran out of yarn, how to i connect my new yarn to the old? just tie it in a knot?
help!!!
thanks!!!