Answered by Sayyidi Habib Umar bin Hafiz (may Allah protect him and benefit us by him)
How can someone make tawassul by their shaykh in times of difficulty?
You do this by asking Allah by the status (‘jah’ or ‘haqq’) of the shaykh as the Prophet ﷺ taught us:
اللَّهُمَّ إِنِّي أَسْأَلُكَ و أَتَوَجَّهُ إِلَيْكَ بِنَبِيِّكَ مُحَمَّدٍ
Allāhumma inni as’aluka wa atawajjawahu ilayka bi nabiyyika Muhammad
O Allah, I ask You and I turn to You through Your Prophet Muhammad..