Formas de hacerlo:

Se puede hacer con Flex Box o con Grid-css.


Tutoriales:

w3schools:
https://www.w3schools.com/css/css3_flexbox.asp?fbclid=IwAR0hh8zRcLiFx_yFqCweuXMN3vRXmvvziVmaB_9jyVbSgBpGNpb1mYtdgNk


Guía Completa de Flexbox desde 0

https://www.youtube.com/watch?v=F-KCncXMPk0&fbclid=IwAR0b7SJCZPjaLQDBAb7sps1PuqufTx95mZKrrIZDuSNl7ilhBCIYKVyKPbM


Curso de CSS GRID: | Introducción y Que es CSS Grid

https://www.youtube.com/watch?v=HpH12iNlLmg&list=PLhSj3UTs2_yWsFd43wpLog5HUFzDgIbWj&fbclid=IwAR05ifWJXVQQdbM6OuyH7in2jOu2D8gPHZl4DDDy2TlAixfC0mA1PUgROQ4


Código:

<head>

<style>

*{

margin:0;

padding:0;

box-sizing:border-box;

}


.flex-container {

  display: flex;

  background-color: #003366;

  justify-content: center;

  align-items: center;

  height: 100%;

}


.flex-container > div {

  padding: 2em;

  background-color: red;

  margin: 2em;

}


.parrafo {

  font-size: 2em; 

  color: Yellow;

  font-family: Arial;

  text-align: center;

  

}

</style>


</head>

<body>

<div class="flex-container">

<div class="parrafo">Texto</div>

</div>

</body>