n brief, Tawassul and Isteghatha are not shirk because:
1- The one who does them is not worshipping the Prophet/Imam. He only worships Allah.
2- Allah has commanded us to seek their intercession. Just as Allah commanded the angels to prostrate to Adam. Was that shirk?
For an in-depth discussion on this, please see:
https://youtu.be/vZO95RyapXY
https://youtu.be/CeIhG0qfpog
https://youtu.be/hZlFsaldkP4
https://youtu.be/eyD5Qa9p_9E
https://youtu.be/SgVLk3kcoHk
You may see the last one especially.