How much and what type of RAM do I need for my Dell OptiPlex?
The best approach is to match the mount of memory with your use case. 16 GB is more then enough for gaming. Take 8 GB for office work and every day home use. For video editing, 3D, or other types of graphics related tasks, use 32 GB.
Another approach is get what you can afford, even if it is overkill now, one or two yeas ahead you may change your mind and start doing task that need lots of memory.
What type of ram depends on your OptiPlex model. Desktops from xx40 series and older use DDR3L-1600 memory. Newer models like 3050 and 5060 use DDR4-2133/2400.
Your best bet for compatible RAM is the Crucial certified OptiPlex kit. But here are other non certified models that will work – Kingston HyperX and Crosshair Vengeance are some of the non-certified choices.