Consider $G(4,p)$ - the random graph on 4 vertices. What is the probability that vertex 1 and 2 lie in the same connected component?
So far, I have considered the event where 1 and 2 do not lie in the same component. Then vertex 1 must lie in a component of order 1, 2 or 3 that doesn't contain vertex 2. However, I am unsure about how to compute these probabilities. For 1 to be in a component if order 1, I think this has probability $(1-p)^3$.
For $p=1/2$, since there are a total of six edges in $K_4$, that means there are only $2^6=64$ possible labeled graphs, each of which is equally likely. You could write out the sample space and count.
When $p\ne 1/2$, you could determine a binomial probability for each possible graph and sum the probabilities of each of the graphs that satisfy your condition (as opposed to straight up counting them in the previous paragraph).
Admittedly, this is a naive approach, but it might give some insight on the general process.