Sudo giving dyld problem. Help for a beginner
On the short term,
within a Terminal enter:

unset DYLD_FALLBACK_LIBRARY_PATH


and check that:

/usr/bin/sudo


is working.

Your description let think of an installer which modified your working
environment in closed relationship with the X11 environment.

To further analyze where this problem is coming, within a Terminal search which initialisation file might be working on this environment variable:

grep DYLD ${HOME}/.profile ${HOME}/.bash_profile ${HOME}/.bashrc


If you are using anything else than sh or bash as your working shell,
search inside the equivalent initialisation files.