I've never had the motivation to learn how to use latex for graphics so I always used draw.io for university assignments. I know a good free logic gate simulator though: http://www.cburch.com/logisim/index.html I'ts a bit weird at first but works great after a while as long as you're not about to build an entire CPU from gates or smt.
Logisim is an easy-to-use visual simulator for digital logic circuits: http://www.cburch.com/logisim/index.html I was able to design a working 16-bit CPU in Logisim just by experimenting and reading some Wikipedia articles.
(The simulation speed is quite poor though, so I gave up before adding pipelining, superscalar, a real MMU, etc.)
Fair enough, but the problem is that your question was overly broad and did not give the impression that you would understand any answers that go into serious detail. A "go read a Wikipedia article on the subject and then rephrase your question" kind of question, if you follow me. It's hard to answer a question like that without sounding condescending, especially when it's assumed that you would need an answer that includes an introduction to the subject.
Incidentally, if you're interested in a more hands-on introduction to the theory of digital circuits, I learned a surprising amount from a flash game called Engineer of the People, which is about building logic circuits from the transistor level, and Logisim, which lets you simulate ideal logic gates and digital circuits. I've built a working CPU in that program, and I've only been an EE student since... next Fall, so I'd say it's a pretty good supplement to a Wikipedia-level education on the subject.