The right way to do that is to slide the knot onto the needle while you use the yarn to tighten the knot. After that, make a loop around your thumb and bring the needle under and up through the loop around the thumb, while carefully removing the thumb afterward. Continue the same process to cast on knitting needles.