[C++] How to fix FPS

Hello, i am new on this forum.
I am a french student, and I program a 3D Player application working with directX.
My question is easy but I can’t find a solution by myself.
I would like to know if a optimized method exist to set the refreshing rate of my main loop at 25 FPS and where I can find it.
I create some function using CPU time to fix FPS but nothing works well.
Thanks if you can help me.