Buy the best lock you can afford. Keep the lock and/or cable off the ground so a thief cannot use the ground for leverage.
Lock your bicycle in a well-lit, well traveled area. Dark alleys ad other out of the way places give thieves time to work. Always lock your bicycle in a bike rack. When there are not bike racks, lock your bicycle to something that cannot be easily broken.
Bike thieves have been known to steal bicycles, lock and all, and break the lock later. Remember, do not park your bicycle against a tree, or where it will block access for persons with disabilities. Think about others. Will your bicycle block a doorway, stairs, crosswalk, ramp or other access, or will it generally be in the way of pedestrians? Keep your bicycle locked indoors overnight, if possible.