Basting can be done with pins, spray, or thread. Spray basting is the easiest method; just be sure to have good ventilation (in an open garage is good). Pins are fine too; just be sure to remove pins as you come to them while you are quilting. Thread basting is usually reserve for quilts that will be hand-quilted; however, it can also be used for machine quilting as long as you clip and remove threads as you go so you don't sew over them. You can also machine-baste with water-soluble thread that rinses out afterwards.
Low-loft batting is easier to machine quilt than high-loft. Polyester batting slides around more than cotton.
If you have been trying to machine quilt without basting first, that is likely to be the cause of your problems. Basting holds the layers together so they don't move while you are machine quilting.