I am trying to prove the following inference rule in Isabelle (2021) from a previous question:
In particular, I tried to prove this in a forward manner, by first using the two assumptions to get A(y) and B(y), and therefore A(y) /\ B(y), for an arbitrarily chosen y. However, I cannot figure out what the right way is to introduce the ∀ back in the last step as shown in the problem line below.
theorem "∀x. A(x) ⟹ ∀x. B(x) ⟹ ∀x. A(x) ∧ B(x)"
proof (rule allI) ―‹forward›
fix y
assume "∀x. A(x)"
from this have 1:"A(y)" by (rule allE)
assume " ∀x. B(x)"
from this have 2:"B(y)" by (rule allE)
from 1 2 have "A(y) ∧ B(y)" by (rule conjI)
―‹problem line: applying allI›
from this have "∀x. A(x) ∧ B(x)" by (rule allI)
Can someone help explain what is the right way to assume and then abstract away the arbitrary variable y here?

I would not say that there is a single "right way" to do this. The "right way" will depend on the context of the problem that you are trying to solve.
In general, the theorem that you are trying to prove can be proved by
simp:In most cases, when trying to prove such results,
simpis the best approach.However, if you are, for example, writing an expository article/tutorial and wish to show how individual steps of the proof can be executed, then, of course, the explicit rule application becomes a necessity. However, in this case, there are still many possibilities.
Firstly, you may use explicit blocks, as the examples below showcase:
However,
proof- ... qedis usually a better alternative and more consistent with the conventional style of exposition in Isabelle, e.g.As a general reference, I suggest section 2.2 in The Isabelle/Isar Reference Manual.