Hello James Chan_110,
Thank you for posting in Q&A forum.
For AD DS, you can follow the steps "To install AD DS by using Server Manager" in the link.
For AD CS, you can follow one of the two links.
The Windows Server® 2012 step-by-step guidance is located at Test Lab Guide: Deploying an AD CS Two-Tier PKI Hierarchy.
Or
A Windows Server® 2008 R2 step-by-step guide is located on the TechNet Wiki as Step by Step Guide - Single Tier PKI Hierarchy Deployment.
If you follow link the first link, you need these steps below.
I hope the information above is helpful.
If you have any questions or concerns, please feel free to let us know.
Best Regards,
Daisy Zhou
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.