The main function of the rectus abdominus is to curl the torso forward. Contrary to popular belief and method, bending at the hips works hip/leg flexors, with minimal involvement to the abdominal muscle.
For growth, you need to stress the muscle as you would any other, with progressive overload in the hypertrophy range for sets/reps. To start, you can do bodyweight exercises such as traditional crunches and hanging leg curls. (For the curls, the initial part will work the hip flexors, then the final curl up works the abs.)
You need to maintain a fairly neutral spine, and avoid curling your neck or putting your hands behind your neck/head to "pull" yourself up. These will lead to the neck pains you are describing.
Also, do not neglect the other core muscles. Obliques are the muscles responsible for rotation of the torso, and the lower back muscles are worked by extension type exercises. All of these together need to be worked, or you risk imbalance that causes back pain as other muscles try to compensate.