I'm not even Catholic, and I know you don't take Communion before you confess and do your penance.
Only if one is aware of being in the state of mortal sin. It is not a requirement to go to confession at all if one is not in the state of mortal sin.