To stop craving love and affection may be hard because they are such ingrained needs, but having knowing and understanding what makes you happy apart from these is vital in stopping the cycle of craving love from others.  To do this you can make a list of all the hobbies you enjoy or the things you like to do with yourself, and begin to love yourself the way you would others.