Luckily for you for an R15 character there is already a community resource for a procedural foot planting system. The maths of the IK in that system also has been covered in this thread. Both of these methods use trigonometric methods to solve the angles of each limb which may be complex to understand especially when applying these angles to manipulate Motor6D C0 CFrames.
Alternatively, you can use my FABRIK Algorithm open source project which does not require trigonometry as it uses vectors manipulation to solve for the limb. However, currently, It’s difficult to make the leg bend in the correct direction which I’m planning to solve. Hopefully, you can start downloading the place files of each project and start experimenting to make your own conclusions on how to make an IK system.