We use gauge theoretic and algebraic methods to examine sufficient conditions for smooth points on the moduli space of flat connections on a compact manifold and on the character variety of a finitely generated and presented group. We give a complete proof of the slice theorem for the action of the group of gauge transformations on the space of flat connections. Consequently, the slice is smooth if the second cohomology of the manifold with coefficients in the semisimple part of the adjoint bundle vanishes. On the other hand, we find that the smoothness of the slice for the character variety of a finitely generated and presented group depends not only on the second group cohomology but also on the relation module of the presentation. However, when there is a single relator or if there is no relation among the relators in the presentation, our condition reduces to the minimality of the second group cohomology. This is also verified using Fox calculus. Finally, we compare the conditions of smoothness in the two approaches.