AUCTeX provides [Font-Specifiers][1] that one can use for such environments as described in the question and which are used often. For instance the following code

 (add-to-list 'LaTeX-font-list
 '(?\C-q "\\underline{" "}"))

will add `underline` to the list of font specifiers. This code must be called after `LaTeX-font-list` is defined. Then when you press `C-c C-f C-q` without selected region `\underline{}` will be created and the cursor is put between the braces. If you have a marked `region` then the result will be `\underline{region}`

 [1]: https://www.gnu.org/software/auctex/manual/auctex/Font-Specifiers.html#Font-Specifiers