Boot your pc from a live distro, like Ubuntu; mount the partition containing the root directory.
Let us assume that partition is /dev/sda2, you can mount it with
sudo mount /dev/sda2 /mnt
Now you do a chroot to the /mnt directory,
sudo chroot /mnt
Now you are effectively root on your hard drive. You can change root and users' passwords by means of:
Now that you have reset passwords, fixing the sudoers file is very simple:
It will ask for your password. Strictly speaking, this requires authorization with PolicyKit. You may fin more information here. Altogether, it is easier than you think.