You have two options basically:
- Content Query Webpart: This webpart can search all the lists in a site and its subsites, in order to return all the items with the content type Task (for example). Then, using the filter you can display to the logged-in user only the tasks that are assigned to her.
The only problem with this solution is that if you have thousands of items it can cause performance issues and it can only search within the same site collection.
For more information check out Inconvenient User Tasks Web Part and how to make it display all tasks
- Search Webpart: This will just search all the sites and site collections for Task items and return the tasks that are assigned to the current user. You will have to create some new managed properties first and search scope.
The only problem with this solution is that the search engine will have to do an incremental crawl before new tasks are actually displayed there. Depending on your settings that may cause even a few hours of delay, depending on how often an incremental search is run on your servers.
For more information check out SharePoint 2010 My Tasks Web Part using Search Driven Cross-Site Query
There is plenty of information online about this.