Stack memory is automatic: variables declared in functions get created and destroyed automatically. Heap memory is manual: you allocate with new and must free with delete.
The heap lets you control lifetime precisely. new returns a pointer to the allocated memory. For single values: int* p = new int; For arrays: int* arr = new int[n]; The pointer lets you access the memory, but you're responsible for eventually freeing it.
Always pair every new with exactly one delete. No delete means a memory leak (wasted memory). Double delete means undefined behavior (likely crash). The rule is simple but easy to violate when code gets complex.