If you are buying the CD at a bank they will tell you how much you will earn if you don’t feel comfortable calculating it yourself.
Most CD’s will automatically roll over if you don’t take action when it matures and it might roll over to a low interest rate and trap your money so that you can’t withdraw it without a penalty. You usually get a week to withdraw the money when it does mature. You sometimes can set it up so the money will automatically go to a savings account or some other account when it matures.
I hate having to worry about when it matures (what if I’m sick or on vacation or forget) so whenever I can I have a CD automatically cash out to a “savings” account. I think it’s a racket that they automatically are set to roll over and lock in again.