There is no set formula for inspiration. It varies from person to person, as inspiration can be found anywhere and everywhere. However, there are a few things that you can do to widen your thoughts and have a fresh outlook towards photography.
Read books written by renowned photographers. Don’t just look for tips but their life experiences and how it changed them. Also visit galleries and art shows and attend photography related talks and workshops. Make sure to interact with the people attending these events. Watch movies to help expand your vision. Alternatively, you can become a member of a photography club too.