The best way to be near to Imam Husain (AS) and Imam Al-Mahdi (AS) is to be always pious and sincere servant of Allah (SWT) by fulfilling all the obligatory acts on its time without delay and avoiding every sinful act. We don't say that all who who can afford to travel to Ziyarah of Imam Hussain (AS) have achieved and reached to this status, as financial reasons are there, but gaining the nearness from Ahlul Bayt (AS) requires piousness and continuous obedience of Allah (SWT) even if your financial situation does not allow you to travel to Karbala,but your piousness will make you near to the Imam (AS) where ever you are and your Ziyarah from far will have the reward of Ziyarah.
'Wassalam.