When you first start up the new Mac, Setup Assistant will open up and walk you through the setup of the new Mac.
One of the steps will ask if you want to transfer the most recent Time Machine backup of your "old" Mac to your "new" Mac. When you do this, your "new" Mac will look just like your "old" Mac.
Connect an Ethernet cable from your Mac to one of the LAN <--> ports on the Time Capsule to establish a connection.
You only get one shot at using Setup Assistant on your Mac. If you bypass that option, then you you can use Migration Assistant........Finder > Applications > Utilities > Migration Assistant to transfer over the backup from Time Machine on the Time Capsule to your new Mac. More info in the Apple Support document below:
Move your content to a new Mac - Apple Support