I am presently studying a first course in particle physics. It does not suppose a formal preparation in mathematical topics such as group theory or symmetries. In the lecture notes for my course, it is mentioned that the number of generators of the group $O(N)$ is $N(N-1)/2$, $SO(N)$ is also $N(N-1)/2$, $U(N)$ is $N^2$ and $SU(N)$ is $N^2 - 1$. I did not fully understand where these numbers come from so I tried to do a bit of googling myself.
I read that the generators of $O(N)$ are $N \times N$ antisymmetric matrices (correct me if I'm wrong). I'm not sure how this leads to the number of generators mentioned above. Secondly, with $SO(N)$ aren't we imposing an extra constraint $\textrm{det(A)} = +1$ so shouldn't we have one less generator? Any explanation for this as well as the cases for $U(N)$ and $SU(N)$ would be greatly appreciated.
P.S.: I do not have a strong background in group theory, Lie groups, Lie algebras and the like