Let me fill in some context for this question first. I've been creating some characters and a few short plot lines for them for fun recently. And it's in a medieval fantasy RPG setting(Skyrim, LOTR, d&d, GoT, etc) And so of course I'm coming across the standard roles such as merchant, knight, town guard, etc.. But I realize that I have absolutely no idea how these concepts worked in real life and I don't want to just make things up.
Some questions I have for example: What was an army made of? Where did they get the non mounted troops and what were they paid? What about militias? And who was fighting who? Was the 'country' even an applicable concept then or were there many civil wars? What was the hierarchy of power? 1 king or several nobles? And how did this differ in different parts of the world.
I'm not necessarily looking for answers to these questions, but a resource I could use to find the answers myself.
A very similar question was asked over the weekend, and you may find the ensuing discussion about what entails "accuracy" in historical fiction interesting.
It's hard to point you in a specific direction because your question isn't narrowed down by time or space. The Middle Ages spanned a long period, and a large and even expanding geographic region in Europe. There are a lot of differences across that temporal-spatial expanse. In general, you might try the New Cambridge Medieval History, which is a good reference for lots of different questions about the Middle Ages in Europe. You may also try Paul Halsall's Internet Medieval Sourcebook for digitized primary sources from the period.
There are also a lot of recommendations for books that have been put together on this sub. I have some specific recommendations on my profile.