Which language do i code it?
doesn't matter. If you wanna go far, pick the one you're best at. That way you have one less hurdle.
Which libraries would i need to use?
I thought you wanted to do it from scratch? The standard libs will probably have all the math functions you need. + Something for keyboard and mouse input handling.
Where to start?
By reading something about 3d rendering. Triangle math. Projections. Lighting. Shaders. etc. You can look at university courses that publish their materials online. Or a book. Or blog guides. Or yt videos. Or stackoverflow. Or reddit posts. (quality drops aproximately in the order i've written it)