How to make mobile version?

I wanna make mobile, and pc version for site. Like a, m.site.com and site.com. Mobile, and PC. How to make this thing?

A ‘dot m’ version for mobile is an older way to make mobile sites.

The modern way is to use responsive web design.

Work through the course at https://learn.freecodecamp.org paying particular attention to the material relating to media queries.