I did not quite understand your attempted solution.
So, first I took some $k$ to be even then $k$ is not the common divisor of $n$ and $n+2$.
Are you saying that if $k$ is even, then $k$ is not the common divisor of $n$ and $n+2$?
That won't be true unless $n$ is odd. Maybe you meant to say "We consider the case that $n$ is odd first."?
Additionally, this statement requires justification. Did you mean to say, "First I will show that for any even number $k$, $k$ is not the common divisor of $n$ and $n+2$."?
If $k|n$ and $k|n+2$ as $k$ is even $\implies 2|k$
I think you meant to say: "Since $k$ is even, $2 \mid k$. Additionally, suppose towards contradiction that $k \mid n$ and $k \mid n+2$ (we will show that this is impossible). Then also $2 \mid n$ and $2 \mid n+2$."
$2|n$ and $2|n+2$ is not possible.
I would not say it's "not possible". Do you mean that it contradicts the fact that $n$ is odd, which we assumed earlier?
If you're doing a proof by contradiction, always say so, and end with a contradiction!
Is my above attempt correct? Are there any better ways to prove the above?
There is a problem with your proof. First, it seems like you only considered the case where $n$ is odd. Second, it seems like you just showed that the common divisor of $n$ and $n+2$ cannot be even. But, what if the common divisor of $n$ and $n+2$ is $3$? What if it is $5$? You need to show that it is $1$, not just that it is not even.
I would suggest you try to write down your ideas more carefully. Once you can write down the ideas carefully, it may help you write a correct solution. Do not allow yourself to make any jumps in the argument that are not perfectly logical and correct.