Hello I am playing piano for four years now and I still have trouble with rhythm (beats). I just want to ask if there is a way to learn how to fit notes into the beats without being born with the sense. I am keeping the rhythm by counting out those notes though I realized that I will struggle with sixteenth notes if I do this longer.
Lots of practice. Practice slowly at first to get a feeling of the rhythmic pattern. The usual counting patterns for 4/4 time are something like.
Quarter notes: 1 - 2 - 3 - 4
Eighth notes: 1 - & - 2 - & - 3 - & - 4 - & -
Sixteenth notes: 1 - a - & - a - 2 - a - & - a - 3 - a - & - a - 4 - a - & - a -
Your muscle memory will get the patterns after a while. Similar comments apply to learning to dance (or play football or the like).
You are born with the sense. But practice will develop it further, as ttw's answer says.
The thing I would suggest is to step away from counting the beats and try using a four-syllable word, like oompaloompa. The numbering and reciting the numbers in sequence can get in the way of "the sense" which is more about how the different moments feels when they happen.
So, take something like the classical 4/4 time where beat 1 has the primary emphasis and beat 3 has the secondary emphasis and 2 and 4 are both subordinate. Oooompah Looompah.
Contrast with a 4/4 rock rhythm, where the 2 and 4 now have accents (constituting the backbeat) but 1 and 3 still have their same strength relative to each other. ooom PAH loom PAH.
2 and 4 are not the same. In either rhythm. 2 has the context of leading into the middle of the measure, but 4 has the context of leading back around again to the next cycle.
So the "practice" is to sometimes stop counting and try to "feel it". It will seem weird and awkward, and then suddenly the neurons will line-up and make their connections faster and it will just click. Believe it. You have a heartbeat and circadian rhythms and the rhythm of your breathing, the pulsing of your stubbed toe.
There are two sides to playing music: what's happening physically, and what's happing mentally. Both your hands and your mind need to be on the same page.
If you need help processing sixteenth notes: If it helps, think of music like math. Rhythm is fractions. You can think about the rhythm in several ways. 1/16 is half the value of 1/8. Which means that a 1/16 note will be twice as frequent as an eighth note. If you were to listen to straight 1/16, every other note falls into rhythm with an 1/8 note. One exercise that exemplifies this is playing 1/8 notes on one hand, and 1/16 notes in the other. Make sure that every other note, the beats align.
If you have trouble physically playing 1/16 notes, use a metronome, and start slow (like 60 bpm). Play straight 1/16 notes on a single finger, then, if your good, move on to the next finger. Once you have completed all ten fingers, bump the metronome 5 clicks, and repeat the process.
Record what you play and listen, use metronome, various rhythm backing tracks. If your keys are hard to press and they do not respond (like on many old and cheap pianos) it is almost impossible to achieve clear fluent passages and arrps. Only truly skilled can play on bad instruments...