One way to stay unbroken in spirit is to always keep your eyes on the goal, knowing that faithful is He who has promised you (Heb. 10: 23). When your vision and mission are defined, and you're sold out completely to this cause, nothing can break your spirit. Be it delays, failures or any other form of setback. A clear goal has a life of its own that stimulates and motivates us regardless of our outcomes!
Jesus exemplified this trait as the writer of Hebrews tells us: "...who for the joy that was set before him endured the cross, despising the shame, and is set down at the right hand of the throne of God" (Heb 12:2). His assignment was enough to keep Him motivated. Do you desire to keep your spirit unbroken? There may be crosses to endure and shame to despise. Get a firm grip of your assignment. Let it speak or engulf you with its own life. Vision is the gasoline on which your life is powered.
For the joy set before Him, Jesus would say to Satan, "Get behind me." Get to be sold out and consumed by your purpose, and resist everything aimed at stopping you from achieving. Whether temptation, persecution, famine or peril, etc, stand tall in the defence and pursuit of your dreams. Make detours when faced with obstacles, if you will, but never give up on your dream. Endure the pain but birth something bigger through it.