It appears that you have overlooked adding the Bootstrap 4 CDN, which stands for (Content Delivery Network)
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css">
<!-- jQuery library -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<!-- Popper JS -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js"></script>
<!-- Latest compiled JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js"></script>
To include this CDN in your project HTML page, it should be placed within the <head></head>
section. Once added, you can utilize it with two different options
First Option
<div class="container">
<div class="row">
<div class="col-12 center">
<div class="card">
<div class="card-body">
This is some text within a card body.
</div>
</div>
</div>
</div>
</div>
Don't forget to include the following CSS in your css file
.center{
display: flex;
justify-content: center;
align-items: center;
}
Second Option
Bootstrap 4 already provides a class called justify-content-center
<div class="container">
<div class="row justify-content-center">
<div class="col-8">
<div class="card">
<div class="card-body">
This is some text within a card body.
</div>
</div>
</div>
</div>
</div>
For a preview, you can visit this link