In this paper, we present an efficient procedure to compute the effective Hamiltonian matrix of a coupled electromagnetic system consisting of subsystems that are coupled to a discrete number of channels through couplers. Each subsystem is described by its own effective non-Hermitian Hamiltonian and the corresponding Quasi-normal Modes (QNMs), while the coupler connecting the subsystems and the channels is described by the scattering matrix, which is equivalent to the transfer matrix, in terms of port vectors defined for the coupler. Due to the constraints imposed by the QNMs of the subsystems and the wave dynamics of the channels, as well as boundary condition constraints, constraint-free port vectors need to be chosen efficiently and they follow two rules: 1) port vectors forming loops with couplers; 2) port vectors of couplers with most constraints or with less freedom. With the constraint-free port vectors chosen, the effective Hamiltonian matrix of the coupled electromagnetic system can be obtained by imposing the boundary condition constraints. After the effective Hamiltonian is obtained, the eigenvalues, eigenvectors and dispersion relation of the coupled electromagnetic system, as well as other quantities such as the reflection and transmission, can be calculated. A 2D interstitial square coupled MRRs array is used as an example to demonstrate the computational procedure. The computation of the effective Hamiltonian matrix of a coupled electromagnetic system has many potential applications such as MRRs array, coupled Parity-Time Non-Hermitian electromagnetic system, as well as the dispersion relation of finite and infinite arrays.