Eucharist

MY Question is can you confess your sins directly to God and then take Eucharist? or must you confess to a priest and then take Eucharist?