Step 1: Write in linear form.
The equation is $\dfrac{dy}{dx} - (\tan x)\,y = 0$. This is of the form $\dfrac{dy}{dx} + Py = Q$ with $P = -\tan x$ and $Q = 0$.
Step 2: Find the integrating factor.
\[ \text{I.F.} = e^{\int -\tan x\,dx} = e^{\log|\cos x|} = \cos x \]
(Here $\int -\tan x\,dx = \log|\cos x|$.)
Step 3: Write the solution.
Multiply by the I.F. and integrate. Since $Q = 0$, the right side integrates to a constant.
\[ y\cos x = C \]
Step 4: Find C.
Put $x = 0$ and $y = 2$: $2\cos 0 = C$, so $C = 2$.
Then $y\cos x = 2$.
Step 5: Check.
From $y = 2\sec x$ we get $y^{\prime} = 2\sec x\tan x = y\tan x$. This matches the given equation, and $y(0) = 2$.
Final Answer:
The particular solution is $y = 2\sec x$.
\[ \boxed{y = 2\sec x} \]