Basic rhythm grouping in 4/4 by Latios212This is a (non-exhaustive) guide to writing out basic rhythms in 4/4. Of course there are always exceptions and complications, but here's what you need to get started!
Notating rhythms is more than just having all your note durations correct. When grouped improperly, they can be difficult to read.

The sheet should expose the underlying beat so that the performer can follow along with the beat. To do this, you can break up notes that pass through important beats by breaking them up into tied notes.
Unless the rhythm is very simple, expose beat 3.If a note duration shorter than a half note (like a quarter note or dotted quarter note) passes through the middle of the measure, split it up. If you have notes tied, divide them up where the measure hits beat 3. Here's an example:

Note how the left hand uses an eighth note tied to a quarter note instead of using a dotted quarter note. That way the quarter note falls on beat 3. For the right hand of the second measure, the dyad is split into a half note tied to an eighth note so that the eighth note falls on beat 3. Doing this will allow the performer to easily see where beat 3, the middle of the measure, lies and will make the music easier to count along with. Here's what I mean:
If you have sixteenth notes, expose the other beats.More intricate rhythms are more difficult to follow along with and you can help the performer by splitting up notes that pass through beats 2 and 4 as well. Here's an example:

Note how it's easy to see all four beats in the left hand because they are grouped separately. And in the right hand, the quarter note is tied to a sixteenth note that falls on beat 4.
This also applies if you have dotted eighth notes. In particular, a (dotted 8th + dotted 8th + 16th) rhythm should split up the middle note into a 16th tied to an 8th.

I haven't mentioned rests at all yet, but the same basic principles apply when you have them - show the beat when needed.

That's pretty much it! If anything's unclear, feel free to ask!