Help me undo gas stove flex connection
A is the fitting on the yellow gas line,
B is the nipple on the black pipe.
The two are made to go together, it is a flared compression fitting and does not flex.
Threaded joints explained.
How to wrap PTFE tape.
a wrench on the nipple (B) holds it from moving while a wrench on fitting (A) turns the fitting counterclockwise. Being a flared connection it does not get pipe dope when you reinstall it.
Since you have loosened B you will need to reset it. It does get pipe dope or PTFE  tape (Teflon) made for gas.  It appears white water Teflon tape was used.
After you get  A and B apart, take B off of the black pipe and thoroughly clean off the threads, apply PTFE tape for gas connections OR pipe dope (not both) and reset B onto the black pipe. It will be helpful to have a PIPE wrench on the black pipe while you tighten the B nipple down. How to use a pipe wrench.