In microgrids management, optimizing resource allocation and enhancing efficiency are critical challenges. This paper introduces the 2-distance coloring technique as a novel approach to address these issues by focusing on the coloring problem of sparse graphs. Through rigorous theoretical derivation, we establish the minimum number of colors required for 2-distance coloring in sparse graph scenarios. Specifically, we demonstrate that for a graph G with an average maximum degree less than 2+17/20 and a maximum degree of 6, it can be list 2-distance colored using no more than 11 colors. This means that, given any set of 11 colors for each vertex, a valid 2-distance coloring can be achieved, ensuring no two adjacent vertices share the same color. This finding is pivotal, as it sets a precedent for the number of resources needed to efficiently manage and allocate resources in microgrids systems through 2-distance coloring. The application of this technique in microgrids promises to revolutionize resource distribution, reducing overlap and maximizing efficiency across the network.