Step one: don't go alone. Bring along a friend who is familiar with bikes and can help you inspect your choice.
Choose a reputable dealer. They will continue to provide you with knowledgeable service and quality parts. You do not want to spend potential on-the-road time, behind the service desk because of unskilled mechanics or under manufactured parts. Even with a warranty this happens and is an incredible waste of energy and time.
When you take delivery, in your excitement, don't forego the inspection before you drive it off the lot. Look for any scratches or nicks in the paint or plastic. Make sure all the parts are installed and in working order, including lights and any electrical selections. See that the tires and the chain are aligned when the bike is upright on its stand. If anything is wrong, leave the bike there until it is fixed to your satisfaction. Only then should you take delivery of the bike.
A good salesperson should go over the bike with you before you leave, showing you how everything works, where the technical data is located and the necessary bike ID serial numbers.