Are you familiar with the OSI protocol stack model? It does not apply exactly to the Ethernet and TCP/IP protocols, but it is a useful tool for describing network protocols and their relations to each other.
CSMA/CD and TCP/IP are on very different layers of the conceptual OSI protocol stack, and perform different functions.
CSMA/CD is the media access control method when using half-duplex Ethernet on various types of cabling:
- 10base2, the "thin" coaxial Ethernet
- 10base5, the "thick" coaxial Ethernet (the original version
- 10base-T, the first twisted-pair Ethernet standard in half-duplex mode
- 100base-TX and other faster twisted-pair Ethernet standards in half-duplex mode
The implementation of CSMA/CD is specific to Layer 1, the physical layer: on coaxial cables it defines a signal amplitude level that indicates a collision, on twisted-pair cabling it's a simple logic: if there is a signal on both this and that pair of wires at the same time, a collision exists.
The Layer-2 protocol of Ethernet has a built-in expectation for CSMA/CD. So it could be said that CSMA/CD is somewhere between Layer 1 and Layer 2, or perhaps part of the interface between the two layers.
When twisted-pair Ethernet cabling is used, CSMA/CD can be essentially turned off it the network is implemented using switches (= multi-port bridges) rather than hubs (= multi-port repeaters). The result is the full-duplex Ethernet we know and love.
On top of the physical layer, there is the data link protocol: Ethernet II/IEEE 802.3. This is Layer 2: the low-level protocols used between devices with effectively direct connections to each other. This layer defines things like MAC addresses and Ethernet-level unicast/multicast/broadcast.
The next higher layer in the usual Internet protocols is IP: it's a protocol that can be routed between multiple distinct networks. This is a significant dividing line: anything at Layer 2 and below is usually tied to a specific hardware technology like Ethernet, but Layer 3 and above are hardware-agnostic.
Beyond Layer 3, the OSI model becomes increasingly inapplicable to the usual Internet protocols, but TCP, UDP and ICMP are all built on top of IP.
IP is not tied to Ethernet at all: you can have one IP network segment using Ethernet and another using Token Ring, and both can talk to each other (and to the rest of the internet) over IP if there is a router between them that has interfaces for both Layer-2 technologies. Since the development of Internet, most Layer-2 network technologies have included provisions to run IP (and/or IPv6) over them. You can even run IP over FibreChannel, a protocol that's usually used in storage networking context, if you want to.