> I mean there are resistors, capacitors all over the place but I really want to learn reason behind it.
There are some good YouTube channels that go into this. EEVBlog[1] has made a lot of really nice videos about the fundamentals, as has w2aew[2]. And I found MicroType Engineering[3] to be a good source of practical information on designing circuits.
Capacitors next to ICs are almost always for decoupling[4]. Similar to how the cistern in your toilet provides a large amounts of water in a short amount of time without affecting the water pressure in the rest of the house, hence decoupling the local water flow from the main supply,
decoupling capacitors can supply a lot of current for a short amount of time.
However what values to use can seemingly be a bit of a black art[5], not helped by the fact there's so much outdated information and rules of thumb out there from the days of through-hole components which just doesn't apply to modern surface mounted components (like needing multiple different values).
On the other hand, resistors on a data line can be there to protect against ESD events[6], for example.
Some of it might be a bit more advanced than what you need right now, but there's definitely some good stuff for people starting out. If for nothing else highlighting areas you should be aware of.
Also Phil's Lab, especially for PCB design specifically (though he covers schematics too, I'd say it's typically not as beginner-friendly/a faster-paced run-through so you understand what he's laying out).
There are some good YouTube channels that go into this. EEVBlog[1] has made a lot of really nice videos about the fundamentals, as has w2aew[2]. And I found MicroType Engineering[3] to be a good source of practical information on designing circuits.
Capacitors next to ICs are almost always for decoupling[4]. Similar to how the cistern in your toilet provides a large amounts of water in a short amount of time without affecting the water pressure in the rest of the house, hence decoupling the local water flow from the main supply, decoupling capacitors can supply a lot of current for a short amount of time.
However what values to use can seemingly be a bit of a black art[5], not helped by the fact there's so much outdated information and rules of thumb out there from the days of through-hole components which just doesn't apply to modern surface mounted components (like needing multiple different values).
On the other hand, resistors on a data line can be there to protect against ESD events[6], for example.
Some of it might be a bit more advanced than what you need right now, but there's definitely some good stuff for people starting out. If for nothing else highlighting areas you should be aware of.
[1]: https://www.youtube.com/@EEVblog/playlists
[2]: https://www.youtube.com/@w2aew/playlists
[3]: https://www.youtube.com/c/MicroTypeEngineering
[4]: https://www.youtube.com/watch?v=BcJ6UdDx1vg
[5]: https://www.youtube.com/watch?v=k7aPb585Y6k
[6]: https://www.youtube.com/watch?v=6OxE06n6n44