I am trying to develop a game with c# on Unity, but when I try to use the rigidbody2d command, the command does not appear on visual studio. I chose visual studio from the external script editor in the external tools section over Unity, but my problem was still not resolved. I installed Unity game development plugins for Visual Studio but my problem did not get fixed again.
This stackoverflow thread cover most of the problems: Unity Scripts edited in Visual studio don't provide autocomplete
If that's not enough, think about adding information such as the Unity / Visual Studio version and other important information.
For my part, I switch to VSCode for my Unity project, the installation is longer but you have more flexibility.