Before coding, ask yourself four questions:
Are all edges weight ? Use BFS.
Are weights non-negative? Use Dijkstra.
Are there negative weights? Use Bellman-Ford.
Do you need all-pairs distances and ? Use Floyd-Warshall.
Each question narrows your options. Answer them in order. The first matching condition determines your algorithm choice. If none match cleanly, combine techniques or look for problem-specific structure to exploit.